本文整理汇总了C++中LoadMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadMenu函数的具体用法?C++ LoadMenu怎么用?C++ LoadMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadMenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: InitInstance
//
// 函数: InitInstance(HINSTANCE, int)
//
// 目的: 保存实例句柄并创建主窗口
//
// 注释:
//
// 在此函数中,我们在全局变量中保存实例句柄并
// 创建和显示主程序窗口。
//
HWND InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // 将实例句柄存储在全局变量中
HWND hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
return NULL;
DragAcceptFiles(hWnd, TRUE);
menu = LoadMenu(hInst, MAKEINTRESOURCE(IDC_PLAYER));
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
TCHAR path[256];
::GetModuleFileName(hInstance, path, 256);
std::wstring wpath = path;
int i = wpath.rfind('\\');
wpath = wpath.substr( 0 ,i);
wpath += _T("\\KGPlayer.dll");
dll = LoadLibrary(wpath.c_str());
if (!dll || INVALID_HANDLE_VALUE == dll)
{
std::wstring msg = _T("加载\"") + wpath + _T("\"失败!");
MessageBox(NULL, msg.c_str(), _T("出错啦!"), MB_OK);
return NULL;
}
typedef HRESULT (_stdcall *CreatePlayerFun)(ICorePlayer** player,HWND recv);
CreatePlayerFun CreatePlayer = (CreatePlayerFun)GetProcAddress(dll ,
(LPCSTR)MAKEINTRESOURCE(3));
if (!CreatePlayer)
{
MessageBox(NULL, _T("创建播放器失败!"), _T("出错啦!"), MB_OK);
return NULL;
}
CreatePlayer(&player,hWnd);
if (!player)
{
MessageBox(NULL, _T("创建播放器失败!"), _T("出错啦!"), MB_OK);
return NULL;
}
player->QueryInterface(IID_IPlayerConfig, (void**)&playerConfig);
if (!playerConfig)
return NULL;
HMENU m = GetSubMenu(menu, 0);
HMENU outMenu = GetSubMenu(m, 3);
if (!outMenu)
return NULL;
DeleteMenu(outMenu, 0, MF_BYPOSITION);
MENUITEMINFO info;
ZeroMemory(&info, sizeof(info));
info.cbSize = sizeof(info);
info.fMask = MIIM_STRING | MIIM_ID | MIIM_CHECKMARKS | MIIM_FTYPE | MIIM_STATE;
info.fType = MFT_RADIOCHECK;
outputCount = 0;
wchar_t name[255] = {0};
while(playerConfig->GetOutputTypeNameList(outputCount, name, 255) != -1)
{
info.wID = AUDIOMENUIDBASE + outputCount;
info.dwTypeData = name;
if (!outputCount)
info.fState = MFS_CHECKED;
else
info.fState = 0;
// info.cch = wcslen(name);
InsertMenuItem(outMenu, outputCount, TRUE, &info);
++outputCount;
}
return hWnd;
}
开发者ID:NonPlayerCharactor,项目名称:player,代码行数:90,代码来源:player.cpp
示例2: m_virtualMachine
CMainWindow::CMainWindow(CPS2VM& virtualMachine, char* cmdLine)
: m_virtualMachine(virtualMachine)
, m_recordingAvi(false)
, m_recordBuffer(nullptr)
, m_recordBufferWidth(0)
, m_recordBufferHeight(0)
, m_recordAviMutex(NULL)
, m_frames(0)
, m_drawCallCount(0)
, m_stateSlot(0)
, m_outputWnd(nullptr)
, m_statusBar(nullptr)
, m_accTable(NULL)
{
m_recordAviMutex = CreateMutex(NULL, FALSE, NULL);
TCHAR sVersion[256];
CAppConfig::GetInstance().RegisterPreferenceBoolean(PREF_UI_PAUSEWHENFOCUSLOST, true);
if(!DoesWindowClassExist(CLSNAME))
{
WNDCLASSEX wc;
memset(&wc, 0, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wc.hInstance = GetModuleHandle(NULL);
wc.lpszClassName = CLSNAME;
wc.lpfnWndProc = CWindow::WndProc;
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
RegisterClassEx(&wc);
}
Create(NULL, CLSNAME, _T(""), WNDSTYLE, Framework::Win32::CRect(0, 0, 640, 480), NULL, NULL);
SetClassPtr();
#ifdef DEBUGGER_INCLUDED
CDebugger::InitializeConsole();
#endif
m_virtualMachine.Initialize();
SetIcon(ICON_SMALL, LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PUREI)));
SetIcon(ICON_BIG, LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PUREI)));
SetMenu(LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MAINWINDOW)));
#ifdef DEBUGGER_INCLUDED
m_debugger = std::unique_ptr<CDebugger>(new CDebugger(m_virtualMachine));
m_frameDebugger = std::unique_ptr<CFrameDebugger>(new CFrameDebugger());
CreateDebugMenu();
#endif
PrintVersion(sVersion, countof(sVersion));
m_outputWnd = new COutputWnd(m_hWnd);
m_statusBar = new Framework::Win32::CStatusBar(m_hWnd);
m_statusBar->SetParts(2, m_statusBarPanelWidths);
m_statusBar->SetText(STATUSPANEL, sVersion);
m_statusBar->SetText(FPSPANEL, _T(""));
//m_virtualMachine.CreateGSHandler(CGSH_Null::GetFactoryFunction());
m_virtualMachine.CreateGSHandler(CGSH_OpenGLWin32::GetFactoryFunction(m_outputWnd));
m_virtualMachine.CreatePadHandler(CPH_DirectInput::GetFactoryFunction(m_hWnd));
m_deactivatePause = false;
m_pauseFocusLost = CAppConfig::GetInstance().GetPreferenceBoolean(PREF_UI_PAUSEWHENFOCUSLOST);
m_virtualMachine.m_gs->OnNewFrame.connect(boost::bind(&CMainWindow::OnNewFrame, this, _1));
SetTimer(m_hWnd, NULL, 1000, NULL);
//Initialize status bar
OnTimer(0);
m_virtualMachine.m_os->OnExecutableChange.connect(boost::bind(&CMainWindow::OnExecutableChange, this));
CreateStateSlotMenu();
CreateAccelerators();
if(strstr(cmdLine, "--cdrom0") != nullptr)
{
BootCDROM();
}
#ifdef DEBUGGER_INCLUDED
if(strstr(cmdLine, "--debugger") != nullptr)
{
ShowDebugger();
}
if(strstr(cmdLine, "--framedebugger") != nullptr)
{
ShowFrameDebugger();
}
#endif
RefreshLayout();
UpdateUI();
//.........这里部分代码省略.........
开发者ID:dona12345,项目名称:Play-,代码行数:101,代码来源:MainWindow.cpp
示例3: spyInit
/*
* spyInit - initialization
*/
static BOOL spyInit( HANDLE currinst, HANDLE previnst, int cmdshow )
{
WNDCLASS wc;
HANDLE memhdl;
WORD i;
i=i;
memhdl = memhdl; /* shut up the compiler for non-NT version */
JDialogInit();
Instance = currinst;
ResInstance = currinst;
if( !InitGblStrings() ) {
return( FALSE );
}
SpyMenu = LoadMenu( ResInstance, "SPYMENU" );
#ifdef __WATCOMC__
_STACKLOW = 0;
#endif
MemStart();
HandleMessageInst = MakeProcInstance( (FARPROC) HandleMessage, Instance );
HintWndInit( Instance, NULL, 0 );
/*
* set up window class
*/
if( !previnst ) {
wc.style = 0L;
wc.lpfnWndProc = SpyWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof( LONG_PTR );
wc.hInstance = Instance;
wc.hIcon = LoadIcon( ResInstance, "APPLICON" );
wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW);
#ifdef __NT__
wc.hbrBackground = NULL;
#else
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
#endif
wc.lpszMenuName = NULL;
wc.lpszClassName = SPY_CLASS_NAME;
if( !RegisterClass( &wc ) ) {
return( FALSE );
}
#ifdef USE_SNAP_WINDOW
if( !RegisterSnapClass( Instance ) ) {
return( FALSE );
}
#endif
}
#ifndef NOUSE3D
CvrCtl3DInit( Instance );
CvrCtl3dRegister( Instance );
CvrCtl3dAutoSubclass( Instance );
#endif
/*
* now make the main window
*/
LoadSpyConfig( NULL );
SpyMainWindow = CreateWindow(
SPY_CLASS_NAME, /* Window class name */
SpyName, /* Window caption */
WS_OVERLAPPEDWINDOW, /* Window style */
SpyMainWndInfo.xpos, /* Initial x position */
SpyMainWndInfo.ypos, /* Initial y position */
SpyMainWndInfo.xsize, /* Initial x size */
SpyMainWndInfo.ysize, /* Initial y size */
(HWND)NULL, /* Parent window handle */
(HMENU)SpyMenu, /* Window menu handle */
Instance, /* Program instance handle */
NULL ); /* Create parameters */
if( SpyMainWindow == NULL ) {
return( FALSE );
}
MyTask = GetWindowTask( SpyMainWindow );
ShowWindow( SpyMainWindow, cmdshow );
UpdateWindow( SpyMainWindow );
InitMessages();
return( TRUE );
} /* spyInit */
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:91,代码来源:spy.c
示例4: SendMessage
void CManageBookmarksDialog::ShowViewMenu()
{
DWORD dwButtonState = static_cast<DWORD>(SendMessage(m_hToolbar,TB_GETSTATE,TOOLBAR_ID_VIEWS,MAKEWORD(TBSTATE_PRESSED,0)));
SendMessage(m_hToolbar,TB_SETSTATE,TOOLBAR_ID_VIEWS,MAKEWORD(dwButtonState|TBSTATE_PRESSED,0));
HMENU hMenu = LoadMenu(GetInstance(),MAKEINTRESOURCE(IDR_MANAGEBOOKMARKS_VIEW_MENU));
UINT uCheck;
if(m_pmbdps->m_bSortAscending)
{
uCheck = IDM_MB_VIEW_SORTASCENDING;
}
else
{
uCheck = IDM_MB_VIEW_SORTDESCENDING;
}
CheckMenuRadioItem(hMenu,IDM_MB_VIEW_SORTASCENDING,IDM_MB_VIEW_SORTDESCENDING,uCheck,MF_BYCOMMAND);
switch(m_pmbdps->m_SortMode)
{
case NBookmarkHelper::SM_NAME:
uCheck = IDM_MB_VIEW_SORTBYNAME;
break;
case NBookmarkHelper::SM_LOCATION:
uCheck = IDM_MB_VIEW_SORTBYLOCATION;
break;
case NBookmarkHelper::SM_VISIT_DATE:
uCheck = IDM_MB_VIEW_SORTBYVISITDATE;
break;
case NBookmarkHelper::SM_VISIT_COUNT:
uCheck = IDM_MB_VIEW_SORTBYVISITCOUNT;
break;
case NBookmarkHelper::SM_ADDED:
uCheck = IDM_MB_VIEW_SORTBYADDED;
break;
case NBookmarkHelper::SM_LAST_MODIFIED:
uCheck = IDM_MB_VIEW_SORTBYLASTMODIFIED;
break;
}
CheckMenuRadioItem(hMenu,IDM_MB_VIEW_SORTBYNAME,IDM_MB_VIEW_SORTBYLASTMODIFIED,uCheck,MF_BYCOMMAND);
RECT rcButton;
SendMessage(m_hToolbar,TB_GETRECT,TOOLBAR_ID_VIEWS,reinterpret_cast<LPARAM>(&rcButton));
POINT pt;
pt.x = rcButton.left;
pt.y = rcButton.bottom;
ClientToScreen(m_hToolbar,&pt);
TrackPopupMenu(GetSubMenu(hMenu,0),TPM_LEFTALIGN,pt.x,pt.y,0,m_hDlg,NULL);
DestroyMenu(hMenu);
SendMessage(m_hToolbar,TB_SETSTATE,TOOLBAR_ID_VIEWS,MAKEWORD(dwButtonState,0));
}
开发者ID:hollylee,项目名称:explorerplusplus,代码行数:62,代码来源:ManageBookmarksDialog.cpp
示例5: WndProc
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// 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)
{
switch (message)
{
case WM_CREATE:
{
switcher = make_shared<Switcher>();
switcher->add_exclusion_process(L"vlc.exe");
switcherThread = make_shared<thread>([] {switcher->run(); });
hTrayMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TRAY));
hTrayPopupMenu = GetSubMenu(hTrayMenu, 0);
ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
nid.cbSize = sizeof(nid);
nid.hWnd = hWnd;
nid.uFlags = NIF_ICON | NIF_MESSAGE;
nid.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_POWERPLANSWITCHER));
nid.uCallbackMessage = WM_USER;
nid.uID = IDI_POWERPLANSWITCHER;
Shell_NotifyIcon(NIM_ADD, &nid);
return DefWindowProc(hWnd, message, wParam, lParam);
}
case WM_COMMAND:
{
int wmId = LOWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case ID_TRAY_EXIT:
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code that uses hdc here...
EndPaint(hWnd, &ps);
}
break;
case WM_USER:
if (lParam == WM_RBUTTONDOWN)
{
POINT p;
GetCursorPos(&p);
TrackPopupMenu(hTrayPopupMenu, TPM_LEFTALIGN | TPM_BOTTOMALIGN, p.x, p.y, 0, hWnd, 0);
break;
}
break;
case WM_DESTROY:
switcher->stop();
switcherThread->detach();
Shell_NotifyIcon(NIM_DELETE, &nid);
DestroyMenu(hTrayMenu);
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
开发者ID:u2718,项目名称:PowerPlanSwitcher,代码行数:82,代码来源:PowerPlanSwitcher.cpp
示例6: WndProc
// ウィンドウプロシージャ
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
HMENU hMenu, hSubMenu;
POINT pt;
switch (msg) {
case WM_RBUTTONDOWN:
// クリックされた位置にポップアップメニューを表示
hMenu = LoadMenu(hInst, TEXT("MYMENU"));
hSubMenu = GetSubMenu(hMenu, 0);
pt.x = LOWORD(lp);
pt.y = HIWORD(lp);
ClientToScreen(hWnd, &pt);
TrackPopupMenu(
hSubMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hWnd, NULL);
DestroyMenu(hMenu);
break;
case WM_COMMAND:
switch (LOWORD(wp)) {
case IDM_TRAY: // 「タスクトレイに入れる」メニュー項目
// NOTIFYICONDATA構造体のメンバをセット
memset(&ni, 0, sizeof(NOTIFYICONDATA));
ni.cbSize = sizeof(NOTIFYICONDATA);
ni.hWnd = hWnd;
ni.uID = ID_MYTRAY;
ni.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
ni.hIcon = (HICON)LoadImage(
hInst, TEXT("MYICON"), IMAGE_ICON, 0, 0, 0);
ni.uCallbackMessage = MYTRAY_MESSAGE;
lstrcpy(ni.szTip, TEXT("猫でもわかるタスクトレイ"));
// タスクトレイにアイコンを表示
Shell_NotifyIcon(NIM_ADD, &ni);
// メインウィンドウを非表示にする
ShowWindow(hWnd, SW_HIDE);
bTray = TRUE;
break;
case IDM_OUT: // 「タスクトレイより出す」メニュー項目
// タスクトレイのアイコンを削除
Shell_NotifyIcon(NIM_DELETE, &ni);
// メインウィンドウを表示
ShowWindow(hWnd, SW_SHOWNORMAL);
bTray = FALSE;
break;
case IDM_END: // 「終了」メニュー項目
SendMessage(hWnd, WM_CLOSE, 0, 0);
break;
}
break;
case MYTRAY_MESSAGE: // タスクトレイ上のイベント
switch(lp) {
case WM_RBUTTONDOWN:
// クリックされた位置にポップアップメニューを表示
hMenu = LoadMenu(hInst, TEXT("MYTRAY"));
hSubMenu = GetSubMenu(hMenu, 0);
GetCursorPos(&pt); // クリック位置を取得
SetForegroundWindow(hWnd);
TrackPopupMenu(
hSubMenu, TPM_BOTTOMALIGN, pt.x, pt.y, 0, hWnd, NULL);
DestroyMenu(hMenu);
break;
default:
return (DefWindowProc(hWnd, msg, wp, lp));
}
break;
case WM_CLOSE:
if (bTray) // タスクトレイにアイコンがあるなら…
// …タスクトレイのアイコンを削除
Shell_NotifyIcon(NIM_DELETE, &ni);
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return (DefWindowProc(hWnd, msg, wp, lp));
}
return 0;
}
开发者ID:tomorrow56,项目名称:VS2010,代码行数:82,代码来源:tasktray01.cpp
示例7: _ExIf
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 命令处理
VOID COpenDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
INT i;
RECT rtRect;
BOOL bPreview;
PUINT puValue;
const UINT c_uFormats[][2] =
{
{352, 288}, {176, 144}, {128, 96},
{320, 240}, {160, 120},
{640, 480}, {320, 240}, {160, 120},
{352, 240}, {352, 288},
{720, 480}, {720, 576},
};
_ExIf((HWND) lParam == m_hToolbar, SetFocus(m_hToolbar));
switch (LOWORD(wParam))
{
case IDC_Open_MulSignText:
if (m_hFormatMenu == NULL)
{
m_hFormatMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_Menu_Format));
}
GetWindowRect(GetDlgItem(m_hWnd, IDC_Open_MulSignText), &rtRect);
TrackPopupMenu(GetSubMenu(m_hFormatMenu, 0), TPM_TOPALIGN, rtRect.left, rtRect.top, 0, m_hWnd, NULL);
break;
case IDM_Format_CIF:
case IDM_Format_QCIF:
case IDM_Format_SUBQCIF:
case IDM_Format_SIF:
case IDM_Format_QSIF:
case IDM_Format_VGA:
case IDM_Format_QVGA:
case IDM_Format_QQVGA:
case IDM_Format_VCDNTSC:
case IDM_Format_VCDPAL:
case IDM_Format_DVDNTSC:
case IDM_Format_DVDPAL:
i = LOWORD(wParam) - IDM_Format_CIF;
SetDlgItemInt(m_hWnd, IDC_Open_Width, c_uFormats[i][0], FALSE);
SetDlgItemInt(m_hWnd, IDC_Open_Height, c_uFormats[i][1], TRUE);
OnCommand(MAKELONG(IDC_Open_Width, EN_KILLFOCUS));
OnCommand(MAKELONG(IDC_Open_Height, EN_KILLFOCUS));
break;
case IDC_Open_Preview:
// 切换预览
if (HIWORD(wParam) == BN_CLICKED)
{
IsPreviewChecked() ? InvalidateRect(m_hWnd, &m_rtPreview, TRUE) : m_pWnd->Stop();
OnCommand(IDC_RawVideo_Seek);
}
break;
case IDC_Open_Width:
case IDC_Open_Height:
case IDC_Open_FrameRate:
case IDC_Open_FrameStep:
if (HIWORD(wParam) == EN_KILLFOCUS)
{
switch (LOWORD(wParam))
{
case IDC_Open_Width:
puValue = &m_riFormat.m_uWidth;
break;
case IDC_Open_Height:
puValue = (PUINT) &m_riFormat.m_iHeight;
break;
case IDC_Open_FrameRate:
puValue = &m_riFormat.m_uFrameRate;
break;
case IDC_Open_FrameStep:
puValue = (PUINT) &m_riFormat.m_iFrameStep;
break;
}
// 限制尺寸范围
*puValue = GetDlgItemInt(m_hWnd, LOWORD(wParam), NULL, TRUE);
m_pWnd->Open(m_pWnd->m_tzFileName, &m_riFormat);
SetDlgItemInt(m_hWnd, LOWORD(wParam), *puValue, TRUE);
}
break;
case IDM_Play_Play:
m_pWnd->TogglePlay();
break;
case IDM_Play_GotoStart:
m_pWnd->Stop();
m_pWnd->Seek(0);
break;
case IDM_Play_GotoEnd:
m_pWnd->Stop();
//.........这里部分代码省略.........
开发者ID:oddstone,项目名称:RawPlayer,代码行数:101,代码来源:OpenDlg.cpp
示例8: m_virtualMachine
CDebugger::CDebugger(CPS2VM& virtualMachine)
: m_virtualMachine(virtualMachine)
{
RegisterPreferences();
if(!DoesWindowClassExist(CLSNAME))
{
WNDCLASSEX wc;
memset(&wc, 0, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wc.hInstance = GetModuleHandle(NULL);
wc.lpszClassName = CLSNAME;
wc.lpfnWndProc = CWindow::WndProc;
RegisterClassEx(&wc);
}
Create(NULL, CLSNAME, _T(""), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, Framework::Win32::CRect(0, 0, 640, 480), NULL, NULL);
SetClassPtr();
SetMenu(LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_DEBUGGER)));
CreateClient(NULL);
//Show(SW_MAXIMIZE);
//ELF View Initialization
m_pELFView = new CELFView(m_pMDIClient->m_hWnd);
m_pELFView->Show(SW_HIDE);
//Functions View Initialization
m_pFunctionsView = new CFunctionsView(m_pMDIClient->m_hWnd);
m_pFunctionsView->Show(SW_HIDE);
m_pFunctionsView->OnFunctionDblClick.connect(boost::bind(&CDebugger::OnFunctionsViewFunctionDblClick, this, _1));
m_pFunctionsView->OnFunctionsStateChange.connect(boost::bind(&CDebugger::OnFunctionsViewFunctionsStateChange, this));
//Threads View Initialization
m_threadsView = new CThreadsViewWnd(m_pMDIClient->m_hWnd, m_virtualMachine);
m_threadsView->Show(SW_HIDE);
m_threadsView->OnGotoAddress.connect(boost::bind(&CDebugger::OnThreadsViewAddressDblClick, this, _1));
//Debug Views Initialization
m_nCurrentView = -1;
memset(m_pView, 0, sizeof(m_pView));
m_pView[DEBUGVIEW_EE] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_ee->m_EE,
std::bind(&CPS2VM::StepEe, &m_virtualMachine), m_virtualMachine.m_ee->m_os, "EmotionEngine");
m_pView[DEBUGVIEW_VU0] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_ee->m_VU0,
std::bind(&CPS2VM::StepEe, &m_virtualMachine), nullptr, "Vector Unit 0", CDisAsmWnd::DISASM_VU);
m_pView[DEBUGVIEW_VU1] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_ee->m_VU1,
std::bind(&CPS2VM::StepVu1, &m_virtualMachine), nullptr, "Vector Unit 1", CDisAsmWnd::DISASM_VU);
m_pView[DEBUGVIEW_IOP] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_iop->m_cpu,
std::bind(&CPS2VM::StepIop, &m_virtualMachine), m_virtualMachine.m_iopOs.get(), "IO Processor");
m_virtualMachine.m_ee->m_os->OnExecutableChange.connect(boost::bind(&CDebugger::OnExecutableChange, this));
m_virtualMachine.m_ee->m_os->OnExecutableUnloading.connect(boost::bind(&CDebugger::OnExecutableUnloading, this));
ActivateView(DEBUGVIEW_EE);
LoadSettings();
if(GetDisassemblyWindow()->IsVisible())
{
GetDisassemblyWindow()->SetFocus();
}
UpdateLoggingMenu();
CreateAccelerators();
}
开发者ID:cmexp,项目名称:Play-,代码行数:69,代码来源:Debugger.cpp
示例9: PropSheetProc
/*
PropSheetProc: Handles special messages pertaining to the property sheet.
Note: See PropSheetProc in the Platform SDK docs for parameters and notes.
*/
int CALLBACK PropSheetProc(HWND sheet, UINT msgid, LPARAM lParam)
{
switch (msgid)
{
case PSCB_PRECREATE:
{
DLGTEMPLATE *templ = (DLGTEMPLATE*)lParam;
templ->cy += 5;
//add a minimize box
templ->style |= WS_MINIMIZEBOX;
}
break;
case PSCB_INITIALIZED:
{
HWND tooltip;
HICON icon;
/* Add Menu. */
propdata.menu = LoadMenu(aokts, (LPCSTR)IDM_MAIN);
SetMenu(sheet, propdata.menu);
//SetSaveState(sheet, MF_GRAYED);
scen.reset();
SendMessage(PropSheet_GetCurrentPageHwnd(sheet), AOKTS_Loading, 0, 0);
MapView_Reset(propdata.mapview, true);
/* Enable appropriate recent file items. */
UpdateRecentMenu(propdata.menu);
/* Remove unused buttons. */
for (int i = 0; i < sizeof(PropSheetButtons) / sizeof(WORD); i++)
{
HWND hWnd = GetDlgItem(sheet, PropSheetButtons[i]);
if (hWnd != NULL)
{
ShowWindow(hWnd, SW_HIDE);
EnableWindow(hWnd, FALSE);
}
}
/* Add a tooltip window */
tooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, "AOKTS Tooltip", WS_POPUP,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
sheet, NULL, aokts, NULL);
TooltipInit(tooltip);
/* Set the big icon */
icon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_LOGO));
Window_SetIcon(sheet, ICON_BIG, icon);
if (setts.editall) {
CheckMenuItem(GetMenu(sheet), ID_EDIT_ALL, MF_BYCOMMAND | MF_CHECKED);
} else {
CheckMenuItem(GetMenu(sheet), ID_EDIT_ALL, MF_BYCOMMAND);
}
}
break;
}
return 0;
}
开发者ID:DoctorWillCU,项目名称:aokts,代码行数:67,代码来源:aokts.cpp
示例10: WinMain
int WINAPI WinMain( HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
WNDCLASSEX winclass;
HWND hwnd;
MSG msg;
HDC hdc;
PAINTSTRUCT ps;
main_instance = hinstance;
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = hinstance;
winclass.hIcon = LoadIcon(hinstance,MAKEINTRESOURCE(IDI_KINGAPP));
winclass.hCursor = LoadCursor(NULL,IDC_ARROW);
winclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = WINDOW_CLASS_NAME;
winclass.hIconSm = LoadIcon(hinstance,MAKEINTRESOURCE(IDI_KINGAPP));
if (!RegisterClassEx(&winclass))
{
return(0);
}
if (!(hwnd = CreateWindowEx( NULL,
WINDOW_CLASS_NAME,
"Sound As Resource Demo",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, // X
0, // Y
400, // WIDTH (INITIAL)
400, // HEIGHT (INITIAL)
NULL, // HANDLE TO PARENT
NULL,
hinstance,
NULL )))
{
return(0);
}
HMENU hmenuhandle = LoadMenu(hinstance,MAKEINTRESOURCE(MainMenu));
SetMenu(hwnd,hmenuhandle);
//ShowCursor(FALSE);
main_window_handle = hwnd;
main_instance = hinstance;
// Game_Init();
while(1)
{
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} // end while
//ShowCursor(TRUE);
return(msg.wParam);
} // end WinMain
开发者ID:amitahire,项目名称:development,代码行数:81,代码来源:Menutst.cpp
示例11: WinMain
/***********************
* WinMain: Main function for window
* @parameter: HINSTANCE _hInstance, game instance
* HINSTANCE _hPrevInstance, previous instance
* LPSTR _lpCmdLine, command line
* int _nCmdShow, command show
* @return:
********************/
int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE _hPrevInstance, LPSTR _lpCmdLine, int _nCmdShow)
{
// This will hold the class we create.
WNDCLASSEX winclass;
MSG msg; // Generic message.
HMENU Menu = LoadMenu(_hInstance, MAKEINTRESOURCE(IDR_MENU1));
// Create const ints for window width and height
const int WINDOW_WIDTH = 1300;
const int WINDOW_HEIGHT = 1080;
// Window class structure.
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = _hInstance;
winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground = CreateSolidBrush(RGB(41,63,151));
winclass.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);
winclass.lpszClassName = WINDOW_CLASS_NAME;
winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
// register the window class
if (!RegisterClassEx(&winclass))
{
return (0);
}
// create the window
hwnd = CreateWindowEx(NULL, // Extended style.
WINDOW_CLASS_NAME, // Class.
"Solitare", // Title.
(WS_OVERLAPPEDWINDOW ^ WS_THICKFRAME) | WS_VISIBLE,
0, 0, // Initial x,y.
WINDOW_WIDTH, WINDOW_HEIGHT, // Initial width, height.
NULL, // Handle to parent.
Menu, // Handle to menu.
_hInstance, // Instance of this application.
NULL); // Extra creation parameters.
// If there is no window
if (!(hwnd))
{
return (0);
}
//Get current monitor Height and Width
HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO info;
info.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(monitor, &info);
int monitor_width = info.rcMonitor.right - info.rcMonitor.left;
int monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
//Resize the window to the height of the monitor
SetWindowPos(hwnd,0,0,0,WINDOW_WIDTH,monitor_height-50,SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
// Seed random
srand((unsigned int)time(0));
//Run the initialization, set up the game
CGame& Game = CGame::GetInstance();
Game.Initialise(_hInstance, hwnd, WINDOW_WIDTH, monitor_height-50);
// Enter main event loop
while (true)
{
// Test if there is a message in queue, if so get it.
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
// Test if this is a quit.
if (msg.message == WM_QUIT)
{
break;
}
// Translate any accelerator keys.
TranslateMessage(&msg);
// Send the message to the window proc.
DispatchMessage(&msg);
}
// Main game processing goes here.
Game.ExecuteOneFrame(); //One frame of game logic occurs here...
}
// Return to Windows like this...
delete &Game;
return (static_cast<int>(msg.wParam));
}
开发者ID:tomob95,项目名称:Solitare,代码行数:98,代码来源:main.cpp
示例12: InitInstance
BOOL InitInstance(HINSTANCE hInstance,int nCmdShow )
{
HDC hDC;
int i;
sysInf.ScreenW = WIN_SIZEX;
sysInf.ScreenH = WIN_SIZEY;
sysInf.hInstance = hInstance;
sysInf.hMenu = LoadMenu( NULL, MAKEINTRESOURCE(IDR_MAINMENU) );
sysInf.bUseBPP24 = CheckScreenMode_BPP24();
SetMyMenuItem();
retryCreateWin:
if(0==sysInf.full_screen){
if(GetSystemMetrics(SM_CXSCREEN)<=WIN_SIZEX || GetSystemMetrics(SM_CYSCREEN)<=WIN_SIZEY){
if(IDYES!=MessageBox(NULL,"この解像度では、Windowモードでは起動できません。フルスクリーンモードでゲームを起動しますか?","カラーモード",MB_YESNO|MB_ICONWARNING)){
return (FALSE);
}else{
sysInf.full_screen = 1;
goto retryCreateWin;
}
}
sysInf.hWnd = CreateWindowEx(
0,className,TITLE_NAME,
WINDOWMODE_STYLE ,
(GetSystemMetrics(SM_CXSCREEN)-sysInf.ScreenW)/2,(GetSystemMetrics(SM_CYSCREEN)-sysInf.ScreenH)/2,
sysInf.ScreenW +GetSystemMetrics(SM_CXDLGFRAME)*2,
sysInf.ScreenH +GetSystemMetrics(SM_CYDLGFRAME)*2 +GetSystemMetrics(SM_CYBORDER) +GetSystemMetrics(SM_CYSIZE) +GetSystemMetrics(SM_CYMENU),
NULL, sysInf.hMenu, hInstance, NULL);
}else{
int full_screen = 1;
sysInf.full_screen = 0;
for(i=0; i<DispFreqMax; i++){
if(sysInf.refreshRate==DispFreq[i]){
full_screen = i+1;
break;
}
}
if(i==DispFreqMax)sysInf.refreshRate = 0;
sysInf.hWnd = CreateWindowEx(
0,className,"鎖−クサリ−",
FULLMODE_STYLE,
0, 0, sysInf.ScreenW, sysInf.ScreenH,
NULL, NULL, hInstance, NULL);
sysInf.hMenuWnd = CreateWindow(className,"menuWnd",WS_POPUP,
0,0,
WIN_SIZEX,GetSystemMetrics(SM_CYMENUSIZE),sysInf.hWnd,sysInf.hMenu,sysInf.hInstance,NULL);
ScreenChange(full_screen , sysInf.refreshRate);
}
if( !sysInf.hWnd )return FALSE;
hDC = GetDC(sysInf.hWnd);
sysInf.bpp = GetDeviceCaps(hDC,BITSPIXEL);
ReleaseDC(sysInf.hWnd,hDC);
if(sysInf.bpp<16){
MessageBox(sysInf.hWnd,"このゲームはHightColor(16Bit 65536色)モード以下のカラーモードでは動作しません。\nTrueColorかHightColorモードに切り替えて起動してください。","カラーモード",MB_OK|MB_ICONWARNING);
return (FALSE);
}
SetCursor(LoadCursor(NULL,IDC_ARROW));
return (TRUE);
} // InitInstance
开发者ID:autch,项目名称:aquaplus_gpl,代码行数:61,代码来源:system.cpp
示例13: DlgProcText
INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
RECT rc, pos;
HWND button;
HMENU hMenu, hMenu1;
TCHAR str[4096];
switch (msg) {
case WM_INITDIALOG:
opt_startup = TRUE;
// set windows position, make it top-most
GetWindowRect(hdlg, &rc);
SetWindowPos(hdlg, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE);
TranslateDialogDefault(hdlg);
// generate the display text for variable list
_tcscpy(str, TranslateT("%c\tcurrent condition\n%d\tcurrent date\n%e\tdewpoint\n%f\tfeel-like temp\n%h\ttoday's high\n%i\twind direction\n%l\ttoday's low\n%m\thumidity\n%n\tstation name\n%p\tpressure\n%r\tsunrise time\n%s\tstation ID\n%t\ttemperature\n%u\tupdate time\n%v\tvisibility\n%w\twind speed\n%y\tsun set"));
SetDlgItemText(hdlg, IDC_VARLIST, str);
// make the more variable and other buttons flat
SendMessage(GetDlgItem(hdlg, IDC_MORE), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM1), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM2), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM3), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM4), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM5), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM6), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM7), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_TM8), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hdlg, IDC_RESET), BUTTONSETASFLATBTN, TRUE, 0);
// load the settings
LoadTextSettings(hdlg);
opt_startup = FALSE;
return TRUE;
case WM_COMMAND:
if (opt_startup) return TRUE;
switch (LOWORD(wParam)) {
case IDC_CTEXT:
case IDC_BTITLE:
case IDC_BTEXT:
case IDC_NTEXT:
case IDC_XTEXT:
case IDC_ETEXT:
case IDC_HTEXT:
case IDC_BTITLE2:
if (HIWORD(wParam) == EN_CHANGE)
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
break;
case IDC_MORE:
// display custom variables list
MoreVarList();
break;
case IDC_TM1:
case IDC_TM2:
case IDC_TM3:
case IDC_TM4:
case IDC_TM5:
case IDC_TM6:
case IDC_TM7:
case IDC_TM8:
WEATHERINFO winfo;
// display the menu
button = GetDlgItem(hdlg, LOWORD(wParam));
GetWindowRect(button, &pos);
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TMMENU));
hMenu1 = GetSubMenu(hMenu, 0);
TranslateMenu(hMenu1);
switch (TrackPopupMenu(hMenu1, TPM_LEFTBUTTON | TPM_RETURNCMD, pos.left, pos.bottom, 0, hdlg, NULL)) {
case ID_MPREVIEW:
// show the preview in a message box, using the weather data from the default station
winfo = LoadWeatherInfo(opt.DefStn);
GetDisplay(&winfo, *var[LOWORD(wParam) - IDC_TM1], str);
MessageBox(NULL, str, TranslateT("Weather Protocol Text Preview"), MB_OK | MB_TOPMOST);
break;
case ID_MRESET:
unsigned varo = LOWORD(wParam) - IDC_TM1;
// remove the old setting from db and free memory
TCHAR* vartmp = *var[varo];
wfree(&vartmp);
SetTextDefault(varname[varo]);
SetDlgItemText(hdlg, cname[varo], *var[varo]);
break;
}
DestroyMenu(hMenu);
break;
case IDC_RESET:
// left click action selection menu
button = GetDlgItem(hdlg, IDC_RESET);
GetWindowRect(button, &pos);
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TMENU));
hMenu1 = GetSubMenu(hMenu, 0);
TranslateMenu(hMenu1);
switch (TrackPopupMenu(hMenu1, TPM_LEFTBUTTON | TPM_RETURNCMD, pos.left, pos.bottom, 0, hdlg, NULL)) {
case ID_T1:
// reset to the strings in memory, discard all changes
LoadTextSettings(hdlg);
break;
//.........这里部分代码省略.........
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:101,代码来源:weather_opt.cpp
示例14: WinMain
int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
Q_UNUSED( hPrevInstance );
Q_UNUSED( nShowCmd );
#if defined(_DEBUG)
/* AllocConsole();
CONSOLE_SCREEN_BUFFER_INFO coninfo;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
coninfo.dwSize.Y = 500;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
int hConHandle;
long lStdHandle;
FILE *fp;
lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
fp = _fdopen( hConHandle, "w" );
*stdout = *fp;
setvbuf( stdout, NULL, _IONBF, 0 );
lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
fp = _fdopen( hConHandle, "w" );
*stderr = *fp;
setvbuf( stderr, NULL, _IONBF, 0 );
QString consoleTitle = QString("%1 %2 %3 - Debug Console").arg(productString()).arg(productBeta()).arg(productVersion());
SetConsoleTitle(consoleTitle.latin1());*/
#endif
INITCOMMONCONTROLSEX initex;
initex.dwICC = ICC_WIN95_CLASSES;
initex.dwSize = sizeof( INITCOMMONCONTROLSEX );
InitCommonControlsEx( &initex );
#pragma comment(lib, "comctl32.lib") // needed for InitCommonControlsEx call
appInstance = hInstance;
guiThread = GetCurrentThreadId();
// Try to load riched20.dll
HMODULE hRiched = LoadLibrary( "riched20.dll" );
if ( !hRiched )
{
MessageBox( 0, "The riched20.dll library could not be found on your system.\nPlease install Microsoft Internet Explorer 4.0 or later.", "Missing DLL", MB_OK | MB_ICONERROR );
return 1;
}
hbSeparator = CreateSolidBrush( RGB( 0xAF, 0xAF, 0xAF ) );
hbBackground = CreateSolidBrush( RGB( 0, 64, 38 ) );
iconGreen = ( HICON ) LoadImage( appInstance, MAKEINTRESOURCE( IDI_ICONGREEN ), IMAGE_ICON, 16, 16, 0 );
iconRed = ( HICON ) LoadImage( appInstance, MAKEINTRESOURCE( IDI_ICONRED ), IMAGE_ICON, 16, 16, 0 );
// Create the WindowClass
WNDCLASSEX wpClass;
ZeroMemory( &wpClass, sizeof( WNDCLASSEX ) );
wpClass.cbSize = sizeof( WNDCLASSEX );
wpClass.hInstance = hInstance;
wpClass.lpfnWndProc = wpWindowProc;
wpClass.hCursor = LoadCursor( NULL, MAKEINTRESOURCE( IDC_ARROW ) );
wpClass.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON1 ) );
wpClass.hbrBackground = hbBackground;
wpClass.lpszClassName = WOLFPACK_CLASS;
wpClass.hIconSm = iconRed;
wpClass.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;
if ( !RegisterClassEx( &wpClass ) )
{
MessageBox( 0, "Couldn't register Window Class.", "Window Class", MB_OK | MB_ICONERROR );
return 1;
}
// Create the Window itself
hmMainMenu = LoadMenu( appInstance, MAKEINTRESOURCE( IDR_MAINMENU ) );
mainWindow = CreateWindow( WOLFPACK_CLASS, "Wolfpack", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, hmMainMenu, hInstance, NULL );
if ( mainWindow == 0 )
{
MessageBox( 0, QString( "Couldn't create the window: " + getErrorString() ).latin1(), "Wolfpack", MB_OK | MB_ICONERROR );
return 1;
}
ShowWindow( mainWindow, SW_NORMAL );
// Create the System Tray Icon
ZeroMemory( &icondata, sizeof( icondata ) );
icondata.cbSize = sizeof( icondata );
icondata.hWnd = mainWindow;
icondata.uID = 0;
icondata.uFlags = NIF_MESSAGE | NIF_ICON;
icondata.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON1 ) );
icondata.uCallbackMessage = WM_TRAY_NOTIFY;
#if !defined(TTS_BALLOON)
# define TTS_BALLOON 0x40
#endif
// This is "ported" from MFC
tooltip = CreateWindowEx( WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, mainWindow, NULL, hInstance, NULL );
if ( tooltip )
{
TOOLINFO info;
info.cbSize = sizeof( info );
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:101,代码来源:console_win.cpp
示例15: WndProc
//.........这里部分代码省略.........
return (LONG)GetStockObject(NULL_BRUSH);
/* 하이퍼링크 부분*/
/*
case WM_SETCURSOR:
if ((HWND)wParam == hwndStatic)
{
if (colormsg == 1) return TRUE;
SendMessage(hwndStatus, SB_SETTEXT, 0, (LONG) "Email : [email protected]");
SendMessage(hwndStatic, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 1);
colormsg = 1;
InvalidateRgn((HWND)hWnd, 0, 1);
SetCursor(mycur);
return TRUE;
}
//If not on the static, change the font back to normal. You don't have to worry
//about the cursor, it will change back to the arrow automatically. I use the
//'colormsg' flag so it doesn't continually set the font when the cursor is moving
//around, because it causes it to flicker. If you only use the cursor change and
//don't worry about the font change you don't have to worry.
if (colormsg == 1)
{
colormsg = 0;
SendMessage(hwndStatus, SB_SETTEXT, 0, 0);
SendMessage(hwndStatic, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0);
InvalidateRgn((HWND)hWnd, 0, 1);
}
break;
*/
/* 마우스 오른쪽 팝업 메뉴 */
case WM_CONTEXTMENU:
hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU1));
hPopup = GetSubMenu(hMenu, 0);
TrackPopupMenu(hPopup, TPM_LEFTALIGN, (short)LOWORD(lParam), (short)HIWORD(lParam), 0, hWnd, NULL);
DestroyMenu(hMenu);
break;
case WM_LBUTTONDOWN:
//BitBlt(GetDC(hWnd), 0, 0, 1000, 1000, 0, 0, 0, WHITENESS); //그냥 화면을 하얗게만 할 뿐 뒤에 남아있음
//image_hyperlink_maker(WinProc_sub, "www.daum.net");
break;
case WM_SIZE:
SendMessage(hState, WM_SIZE, wParam, lParam);
/* 스크롤바 부분 */
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case 50001: favorite_clicked(50001);break; case 50002: favorite_clicked(50002);break; case 50003: favorite_clicked(50003);break;
case 50004: favorite_clicked(50004);break; case 50005: favorite_clicked(50005);break; case 50006: favorite_clicked(50006);break;
case 50007: favorite_clicked(50007);break; case 50008: favorite_clicked(50008);break; case 50009: favorite_clicked(50009);break;
case 50010: favorite_clicked(50010);break; case 50011: favorite_clicked(50011);break; case 50012: favorite_clicked(50012);break;
case IDC_MAIN_BUTTON: // when button is clicked, this will happen: 버튼부분
SendMessage(EdittextBox, WM_GETTEXT, sizeof(textbox_buffer) / sizeof(textbox_buffer[0]), reinterpret_cast<LPARAM>(textbox_buffer));
if(input_valid_check(textbox_buffer) == 1) // 주소체크하고 dns 실행할지말지 결정
Save_visit_page(textbox_buffer);
InvalidateRect(Main_hWnd, NULL, WM_ERASEBKGND);
UpdateWindow(Main_hWnd);
break;
开发者ID:LeeSangJae,项目名称:18533,代码行数:66,代码来源:test.cpp
示例16: WinMain
int WINAPI WinMain( HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
WNDCLASSEX winclass;
HWND hwnd;
MSG msg;
HDC hdc;
PAINTSTRUCT ps;
ClockTick *ticker = new ClockTick(250);
main_instance = hinstance;
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = hinstance;
winclass.hIcon = LoadIcon(hinstance,MAKEINTRESOURCE(IDI_SMALL));
winclass.hCursor = LoadCursor(NULL,IDC_ARROW);
winclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = WINDOW_CLASS_NAME;
winclass.hIconSm = LoadIcon(hinstance,MAKEINTRESOURCE(IDI_SMALL));
if (!RegisterClassEx(&winclass))
{
return(0);
}
if (!(hwnd = CreateWindowEx( NULL,
WINDOW_CLASS_NAME,
"Sound As Resource Demo",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, // X
|
请发表评论