本文整理汇总了C++中HANDLE_MSG函数的典型用法代码示例。如果您正苦于以下问题:C++ HANDLE_MSG函数的具体用法?C++ HANDLE_MSG怎么用?C++ HANDLE_MSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HANDLE_MSG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CharFaceDialogProc
BOOL CALLBACK CharFaceDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
CharFaceInitDialog(hDlg);
break;
case WM_NOTIFY:
switch (((LPNMHDR) lParam)->code)
{
case PSN_SETACTIVE:
break;
}
return TRUE;
case WM_DRAWITEM:
CharDrawFace();
return TRUE;
HANDLE_MSG(hDlg, WM_COMMAND, CharFaceCommand);
HANDLE_MSG(hDlg, WM_HSCROLL, CharFaceHScroll);
}
return FALSE;
}
示例2: WndProc
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
TCHAR szHello[MAX_LOADSTRING];
switch (message)
{
HANDLE_MSG(hWnd, WM_DESTROY, OnDestroy);
HANDLE_MSG(hWnd, WM_CREATE, OnCreate);
HANDLE_MSG(hWnd, WM_SETFOCUS, OnSetFocus);
HANDLE_MSG(hWnd, WM_SIZE, OnSize);
HANDLE_MSG(hWnd, WM_COMMAND, OnCommand);
case WM_PAINT:
RECT rt;
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rt);
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
DrawText(hdc, szHello, _tcslen(szHello), &rt,
DT_SINGLELINE | DT_VCENTER | DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_SETTINGCHANGE:
SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
示例3: while
INT_PTR IDialog::lpStaticDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
auto it = dlgList.begin();
// It will be replaced with a message filter
if (uMsg == WM_INITDIALOG || uMsg == WM_COMMAND || uMsg == WM_CLOSE) {
while (it != dlgList.end()) {
if (it->first && !it->second) {
it->first->hWndThis_ = hWnd;
it->second = hWnd;
break;
}
++it;
}
it = dlgList.begin();
if (it->second != hWnd) {
it = dlgList.begin();
while (it->second != hWnd) ++it;
}
}
switch (uMsg) {
HANDLE_MSG(hWnd, WM_INITDIALOG, it->first->OnInitDialog);
HANDLE_MSG(hWnd, WM_COMMAND, it->first->OnCommand);
HANDLE_MSG(hWnd, WM_CLOSE, it->first->OnClose);
}
return FALSE;
}
示例4: MapHDDWinM_OnCommand
//------------------------------------------------------------------------------
#pragma argsused
static void MapHDDWinM_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT CodeNotify)
{
switch(id)
{
#if defined TEST_FAT1_VOST //Проверка и восстановление FAT1 на потерянные кластеры
case IDC_VOST: Vost_FAT1(); //Чистка FAT1 от потерянных кластеров
break;
#endif
case IDOK: DestroyWindow(hwnd);
break;
}
}
//------------------------------------------------------------------------------
#pragma argsused
static LRESULT CALLBACK WndProc_MapHDD_W1(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
HANDLE_MSG(hwnd, WM_PAINT, MapHDDWin1_OnPaint);
default: return DefWindowProc(hwnd, Msg, wParam, lParam);
}
}
//------------------------------------------------------------------------------
#pragma argsused
static void MapHDDWinM_OnDestroy(HWND hwnd)
{
示例5: view_xmlexDialogProc
LRESULT CALLBACK view_xmlexDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
{
/* first, ask the dialog skinning system if it wants to do anything with the message
the function pointer gets set during WM_INITDIALOG so might be NULL for the first few messages
in theory we could grab it right here if we don't have it, but it's not necessary
and I wanted to put all the function pointer gathering code in the same place for this example */
if (ml_hook_dialog_msg)
{
INT_PTR a = ml_hook_dialog_msg(hwndDlg, uMsg, wParam, lParam);
if (a)
return a;
}
switch(uMsg) {
HANDLE_MSG(hwndDlg, WM_INITDIALOG, xmlex_OnInitDialog);
HANDLE_MSG(hwndDlg, WM_TIMER, xmlex_OnTimer);
HANDLE_MSG(hwndDlg, WM_COMMAND, xmlex_OnCommand);
HANDLE_MSG(hwndDlg, WM_SIZE, xmlex_OnSize);
case WM_PAINT:
{
int tab[] = { IDC_LIST|DCW_SUNKENBORDER};
ml_draw(hwndDlg, tab, sizeof(tab) / sizeof(tab[0]));
}
return 0;
HANDLE_MSG(hwndDlg, WM_DESTROY, xmlex_OnDestroy);
}
return FALSE;
}
示例6: GetWindowRect
LRESULT CALLBACK se_task::Cruler::_wndProc( HWND hWnd, unsigned int Msg, WPARAM wParam, LPARAM lParam )
{
if (Msg == UWM_MOUSEMOVE)
{
RECT rc;
GetWindowRect(hWnd, &rc);
POINT pt;
GetCursorPos(&pt);
Cruler::_crulerOnMouseMove(hWnd, pt.x - rc.left, pt.y - rc.top, wParam);
return 0;
}
if (Msg == UWM_LBUTTONUP)
{
Cruler::_crulerOnLButtonUp(hWnd, 0, 0, 0);
return 0;
}
switch (Msg)
{
HANDLE_MSG(hWnd, WM_LBUTTONDOWN, Cruler::_crulerOnLButtonDown);
HANDLE_MSG(hWnd, WM_LBUTTONUP, Cruler::_crulerOnLButtonUp);
HANDLE_MSG(hWnd, WM_MOUSEMOVE, Cruler::_crulerOnMouseMove);
HANDLE_MSG(hWnd, WM_PAINT, Cruler::_crulerOnPaint);
HANDLE_MSG(hWnd, WM_SIZE, Cruler::_crulerOnSize);
}
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
示例7: PetscWndProc
LRESULT CALLBACK PetscWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PetscFunctionBegin;
switch (message) {
HANDLE_MSG(hWnd,WM_PAINT,OnPaint_Win32);
HANDLE_MSG(hWnd,WM_DESTROY,OnDestroy_Win32);
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
/* Parse the menu selections:*/
switch (wmId) {
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_LBUTTONUP:
MouseRecord_Win32(hWnd,PETSC_BUTTON_LEFT);
break;
case WM_RBUTTONUP:
MouseRecord_Win32(hWnd,PETSC_BUTTON_RIGHT);
break;
case WM_MBUTTONUP:
MouseRecord_Win32(hWnd,PETSC_BUTTON_CENTER);
break;
default:
PetscFunctionReturn(DefWindowProc(hWnd, message, wParam, lParam));
}
PetscFunctionReturn(0);
}
示例8: WndProc
LRESULT CALLBACK
WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
switch (uiMsg) {
HANDLE_MSG(hwnd, WM_CREATE, OnCreate);
HANDLE_MSG(hwnd, WM_SIZE, OnSize);
HANDLE_MSG(hwnd, WM_DESTROY, OnDestroy);
HANDLE_MSG(hwnd, WM_PAINT, OnPaint);
case WM_PRINTCLIENT: OnPrintClient(hwnd, (HDC)wParam); return 0;
case WM_CONTEXTMENU:
if (lParam != -1 &&
SendMessage(hwnd, WM_NCHITTEST,
0, lParam) == HTSYSMENU) {
HMENU hmenu = CreatePopupMenu();
if (hmenu) {
AppendMenu(hmenu, MF_STRING, 1,
TEXT("Custom menu"));
TrackPopupMenu(hmenu, TPM_LEFTALIGN |
TPM_TOPALIGN |
TPM_RIGHTBUTTON,
GET_X_LPARAM(lParam),
GET_Y_LPARAM(lParam), 0, hwnd,
NULL);
DestroyMenu(hmenu);
}
return 0;
}
break;
}
return DefWindowProc(hwnd, uiMsg, wParam, lParam);
}
示例9: EventDlgProc
LRESULT CALLBACK EventDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HWND hctlListbox;
switch (uMsg)
{
case WM_PLEASE_DISPLAY:
hctlListbox = GetDlgItem(hDlg, IDC_RESULTS);
ListBox_SetTopIndex(hctlListbox, ListBox_AddString(hctlListbox, lParam));
break;
case WM_CLOSE:
DestroyWindow(hDlg);
hDlgMain = NULL;
break;
case WM_DESTROY:
return TRUE;
break;
HANDLE_MSG(hDlg, WM_INITDIALOG, EventDlg_OnInitDialog);
HANDLE_MSG(hDlg, WM_COMMAND, EventDlg_OnCommand);
default:
return (FALSE);
}
return 0;
}
示例10: WndProc
// Window Procedure
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
HANDLE_MSG (hWnd, WM_CREATE, OnCreate );
HANDLE_MSG (hWnd, WM_DESTROY, OnDestroy );
HANDLE_MSG (hWnd, WM_PAINT, OnPaint );
case WM_COPYDATA:
return OnCopyData( hWnd, (HWND)wParam, (PCOPYDATASTRUCT)lParam );
default:
if( msg == WM_SKYPECONTROL_ATTACH){
if(lParam == 0){
hSkypeWnd = (HWND)wParam;
}
jclass clazz = envWndProc->GetObjectClass(*objWndProc);
if( clazz == NULL ){
printf("cannot find class\n");
}
jmethodID methodid = envWndProc->GetMethodID( clazz,
"jni_onAttach", "(I)V");
if( methodid == NULL ){
printf("cannot find methodid\n");
}
envWndProc->CallIntMethod(*objWndProc, methodid, (int)lParam );
}
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
示例11: WndProc
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
switch (message)
{
HANDLE_MSG(hWnd, WM_CHAR, OnChar);
HANDLE_MSG(hWnd, WM_CREATE, OnCreate);
HANDLE_MSG(hWnd, WM_PAINT, OnPaint);
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_HELP_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_FILE_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_DESTROY:
CommandBar_Destroy(hwndCB);
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
示例12: textWndProc
static LRESULT CALLBACK textWndProc(
HWND hwnd,
UINT message,
WPARAM wParam,
LPARAM lParam)
{
switch(message)
{
HANDLE_MSG(hwnd,WM_CLOSE, text_OnClose);
HANDLE_MSG(hwnd,WM_COMMAND, text_OnCommand);
HANDLE_MSG(hwnd,WM_CONTEXTMENU, text_OnContextMenu);
HANDLE_MSG(hwnd,WM_CTLCOLOREDIT, text_OnCtlColorEdit);
HANDLE_MSG(hwnd,WM_DESTROY, text_OnDestroy);
HANDLE_MSG(hwnd,WM_INITMENUPOPUP,text_OnInitMenuPopup);
HANDLE_MSG(hwnd,WM_MDIACTIVATE,text_OnMDIActivate);
HANDLE_MSG(hwnd,WM_QUERYENDSESSION, text_OnQueryEndSession);
HANDLE_MSG(hwnd,WM_SETFOCUS, text_OnSetFocus);
HANDLE_MSG(hwnd,WM_SIZE, text_OnSize);
case UWM_UPDATE_MENU:
text_OnUpdateMenu(hwnd,GetMenu(hMainFrame));
text_OnUpdateMenu(hwnd,TextContextMenu);
return 0;
case UWM_CONTEXTMENU:
return HANDLE_WM_CONTEXTMENU(hwnd,wParam,lParam,
text_OnContextMenu);
}
return DefMDIChildProc(hwnd, message, wParam, lParam);
}
示例13: WndProc
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
TCHAR szHello[MAX_LOADSTRING];
switch (message)
{
HANDLE_MSG(hWnd, WM_CREATE, OnCreate);
HANDLE_MSG(hWnd, WM_COMMAND, OnCommand);
case WM_PAINT:
RECT rt;
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rt);
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
DrawText(hdc, szHello, _tcslen(szHello), &rt,
DT_SINGLELINE | DT_VCENTER | DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
CommandBar_Destroy(hwndCB);
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
示例14: PrintDlgProc
LRESULT CALLBACK PrintDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_CLOSE:
DestroyWindow(hDlg);
hDlgMain = NULL;
break;
case WM_DESTROY:
return TRUE;
break;
case WM_SHOWBITMAP:
if (gbmpDisplay)
DeleteObject(gbmpDisplay);
gDisplayRect = *(RECT*)wParam;
gbmpDisplay = (HBITMAP) lParam;
InvalidateRect(hDlgMain, NULL, TRUE);
break;
HANDLE_MSG(hDlg, WM_INITDIALOG, PrintDlg_OnInitDialog);
HANDLE_MSG(hDlg, WM_COMMAND, PrintDlg_OnCommand);
HANDLE_MSG(hDlg, WM_PAINT, PrintDlg_OnPaint);
default:
return (FALSE);
}
return 0;
}
示例15: guiWndProc
long PASCAL guiWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
gui.wParam = wParam;
gui.lParam = lParam;
switch (message)
{
HANDLE_MSG(hwnd, WM_CREATE, guiOnCreate);
HANDLE_MSG(hwnd, WM_COMMAND, guiOnCommand);
HANDLE_MSG(hwnd, WM_MENUSELECT, guiOnMenuSelect);
HANDLE_MSG(hwnd, WM_SIZE, guiOnSize);
HANDLE_MSG(hwnd, WM_CLOSE, guiOnClose);
HANDLE_MSG(hwnd, WM_PAINT, guiOnPaint);
HANDLE_MSG(hwnd, WM_SETCURSOR, guiOnSetCursor);
HANDLE_MSG(hwnd, WM_LBUTTONDOWN, guiOnLButtonDown);
HANDLE_MSG(hwnd, WM_LBUTTONUP, guiOnLButtonUp);
HANDLE_MSG(hwnd, WM_MOUSEMOVE, guiOnMouseMove);
case WM_CAPTURECHANGED:
guiOnCaptureChanged((HWND)lParam);
return 0;
case WM_SHELLNOTIFY:
return guiOnShellNotify(wParam, lParam);
}
return DefWindowProc(hwnd, message, wParam, lParam);
}