Stealth Dialog-CodeProject 참조
origin : http://www.codeproject.com/KB/shell/StealthDialog.aspx?print=true
//sdkdlg.cpp
// Win32 Dialog.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "resource.h"
// Global Variables:
HINSTANCE hInst; // current instance
// Forward declarations of functions included in this code module:
BOOL InitInstance(HINSTANCE, int);
BOOL OnInitDialog(HWND hWnd);
INT_PTR CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
//HACCEL hAccelTable;
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow)) return FALSE;
//hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_STEALTHDIALOG);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, NULL, &msg)||
!IsDialogMessage(msg.hwnd,&msg) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
// Initialize the window and tray icon
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
// prepare for XP style controls
InitCommonControls();
// store instance handle and create dialog
hInst = hInstance;
HWND hWnd = CreateDialog( hInstance, MAKEINTRESOURCE(IDD_DLG_DIALOG),
NULL, (DLGPROC)DlgProc );
if (!hWnd) return FALSE;
// call ShowWindow here to make the dialog initially visible
ShowWindow(hWnd, SW_RESTORE);
return TRUE;
}
BOOL OnInitDialog(HWND hWnd)
{
return TRUE;
}
// Message handler for the app
INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
switch (message)
{
case WM_SYSCOMMAND:
if((wParam & 0xFFF0) == SC_MINIMIZE)
{
ShowWindow(hWnd, SW_HIDE);
return 1;
}
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
//switch (wmId) { }
return 1;
case WM_INITDIALOG:
return OnInitDialog(hWnd);
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return 0;
}
'Code' 카테고리의 다른 글
[vb] 데이터 형 변환 (타입캐스팅) (0) | 2008.11.05 |
---|---|
[vc6] Release Build 에서 security_check_cookie 에러가 날때 (0) | 2008.11.05 |
텍스트 큐브 설치 (0) | 2008.11.05 |
제로보드 XE 1.0.3 설치 (0) | 2008.11.05 |
Visual Studio 2008(vc9) 설정을 Visual Studio 6(vs6)으로 바꾸기 (0) | 2008.11.05 |