// // FUNCTION: InitInstance(HANDLE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The window class name hInst = hInstance; // Store instance handle in our global variable // Initialize global strings LoadString(hInstance, IDC_OTTEST, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance, szWindowClass); LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); if (hwndCB) CommandBar_Show(hwndCB, TRUE); return TRUE; }
LONG OnAddClick(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam) { DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG_Admin_Add),NULL,DlgAdminAddPorc); //DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG_OPERATOR),NULL,DlgOperatorPorc); CommandBar_Show(NULL, FALSE); EndDialog(hDlg,0); return TRUE; }
LRESULT CLogView::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { #if defined( OS_WINCE ) #if !defined (OS_PLATFORM_MOTCE) SHINITDLGINFO shidi; shidi.dwMask = SHIDIM_FLAGS; shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;//SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN |SHIDIF_EMPTYMENU; shidi.hDlg = m_hWnd; SHInitDialog(&shidi); SHMENUBARINFO mbi = { sizeof(mbi), 0 }; mbi.hwndParent = m_hWnd; mbi.nToolBarId = IDR_LOGMENUBAR; // ID of toolbar resource mbi.hInstRes = _AtlBaseModule.GetResourceInstance(); mbi.dwFlags = SHCMBF_HMENU; SHCreateMenuBar(&mbi); // SendDlgItemMessage(IDC_LOGEDIT,WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT),0); #else SetWindowLong(GWL_STYLE,(long)WS_BORDER); ShowWindow(SW_MAXIMIZE); m_hWndCommandBar = CommandBar_Create(_AtlBaseModule.GetResourceInstance(), m_hWnd, 1); CommandBar_AddAdornments(m_hWndCommandBar, 0, 0 ); HMENU menu = LoadMenu(0, MAKEINTRESOURCE(IDR_LOGMENUBAR)); CommandBar_InsertMenubarEx(m_hWndCommandBar, 0, (LPTSTR)menu, 0); CommandBar_DrawMenuBar(m_hWndCommandBar, 0); CommandBar_Show(m_hWndCommandBar, TRUE); #endif loadLogText(); #elif defined(OS_WINDOWS) m_grip.InitGrip(m_hWnd); m_grip.ShowSizeGrip(); CWindow edit = GetDlgItem(IDC_LOGEDIT); ::SendMessage(edit.m_hWnd,EM_EXLIMITTEXT,0,2147483647); ::SendMessage(edit.m_hWnd, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS); SetTimer(100,1000,NULL); RECT rc = { 0,0,500,400 }; rc.left = getIniInt(_T("log_view_left"),0); rc.top = getIniInt(_T("log_view_top"),0); int width = getIniInt(_T("log_view_width"),500); rc.right = rc.left+width; int height = getIniInt(_T("log_view_height"),400); rc.bottom = rc.top+height; MoveWindow(&rc); #endif //OS_ bHandled = TRUE; return 1; // Let the system set the focus }
// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; // title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name g_hInst = hInstance; // Store instance handle in our global variable LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_VOLUME_INFO, szWindowClass, MAX_LOADSTRING); if (!MyRegisterClass(hInstance, szWindowClass)) { return FALSE; } hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); if (g_hWndCommandBar) { CommandBar_Show(g_hWndCommandBar, TRUE); } /*char NameBuffer[MAX_PATH]; char SysNameBuffer[MAX_PATH]; DWORD VSNumber; DWORD MCLength; DWORD FileSF; FILE * pFileTXT; if (GetVolumeInformation("C:\\",NameBuffer, sizeof(NameBuffer), &VSNumber,&MCLength,&FileSF,SysNameBuffer,sizeof(SysNameBuffer))) { pFileTXT = fopen ("\\Storage Card\\volume_info.txt","a"); fprintf(pFileTXT, "NameBuffer='%s', SysNameBuffer='%s', VSNumber='%d'\n" ,NameBuffer,SysNameBuffer,VSNumber); fprintf (pFileTXT, " navitel not running \n"); fclose (pFileTXT); }*/ return TRUE; }
LRESULT CLogOptionsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { #if defined( OS_WINCE ) if(winversion == 1) { //#if defined( OS_WINCE ) && !defined (OS_PLATFORM_MOTCE) SHINITDLGINFO shidi; shidi.dwMask = SHIDIM_FLAGS; shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;//SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN |SHIDIF_EMPTYMENU; shidi.hDlg = m_hWnd; SHInitDialog(&shidi); SHMENUBARINFO mbi = { sizeof(mbi), 0 }; mbi.hwndParent = m_hWnd; mbi.nToolBarId = IDR_LOGOPTIONSMENUBAR; // ID of toolbar resource mbi.hInstRes = _AtlBaseModule.GetResourceInstance(); mbi.dwFlags = SHCMBF_HMENU; SHCreateMenuBar(&mbi); } else if(winversion == 2) { //#elif defined (OS_PLATFORM_MOTCE) SetWindowLong(GWL_STYLE,(long)WS_BORDER); m_hWndCommandBar = CommandBar_Create(_AtlBaseModule.GetResourceInstance(), m_hWnd, 1); CommandBar_AddAdornments(m_hWndCommandBar, CMDBAR_OK, 0 ); CommandBar_Show(m_hWndCommandBar, TRUE); //#endif //OS_WINCE } #endif SendDlgItemMessage(IDC_CBXLEVELS,CB_ADDSTRING,0, (LPARAM)_T("Trace")); SendDlgItemMessage(IDC_CBXLEVELS,CB_ADDSTRING,0, (LPARAM)_T("Info")); SendDlgItemMessage(IDC_CBXLEVELS,CB_ADDSTRING,0, (LPARAM)_T("Warning")); SendDlgItemMessage(IDC_CBXLEVELS,CB_ADDSTRING,0, (LPARAM)_T("Error")); SendDlgItemMessage(IDC_CBXLEVELS,CB_SETCURSEL,LOGCONF().getMinSeverity(),0); CStringW strW(LOGCONF().getEnabledCategories().c_str()); SetDlgItemText(IDC_MSGCLASSES, strW ); strW = LOGCONF().getDisabledCategories().c_str(); SetDlgItemText(IDC_MSGEXCLUDE, strW ); bHandled = TRUE; return 1; // Let the system set the focus }
LONG OnAdminModifyClick(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam) { ModifyMark = ListView_GetSelectionMark(hWndList)+1; if (ModifyMark !=0) { //读取限速器类型文件 HANDLE hFile = CreateFile(TypeFileName, GENERIC_READ , FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if( hFile == INVALID_HANDLE_VALUE) return FALSE; int index = 0; char detector[120] = {NULL};//读取文件内容到该缓存 char buf[20] = {NULL}; DWORD dwRead = -1; SetFilePointer(hFile,(ModifyMark-1)*120,NULL,FILE_CURRENT); ReadFile(hFile,(LPVOID)detector,120,&dwRead,NULL); _stprintf_s(TestsFileName,50,_T("\\NandFlash\\detector_")); memcpy(TestsFileName+20,detector+20,5); int i = 0; for (i = 0; i <5; i++) { if (detector[20+i*2] == NULL) { break;; } } _stprintf_s(TestsFileName+20+i,60,_T(".txt")); CloseHandle(hFile); DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG_Admin_Add),NULL,DlgAdminAddPorc); //DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG_OPERATOR),NULL,DlgOperatorPorc); CommandBar_Show(NULL, FALSE); EndDialog(hDlg,0); } return TRUE; }
// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; // title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name g_hInst = hInstance; // Store instance handle in our global variable LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_ST_DEMO, szWindowClass, MAX_LOADSTRING); if (!MyRegisterClass(hInstance, szWindowClass)) { return FALSE; } hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } MoveWindow(hWnd, 0 ,0, 800,480 ,TRUE); TestST(hWnd); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); if (g_hWndCommandBar) { CommandBar_Show(g_hWndCommandBar, TRUE); } return TRUE; }
BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; TCHAR szWindowClass[MAX_LOADSTRING]; hInst = hInstance; /* Init stack */ if (OnInitStack() == FALSE) return FALSE; LoadString (hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); MyRegisterClass (hInstance, szWindowClass); LoadString (hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); hWnd = CreateWindow (szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } hMainWnd = hWnd; ShowWindow (hWnd, nCmdShow); UpdateWindow (hWnd); if (hwndCB) CommandBar_Show (hwndCB, TRUE); SetTimer (hMainWnd, ID_POLL_TIMER, 50, NULL); pjsua_detect_nat_type(); return TRUE; }
// // FUNCTION: InitInstance(HANDLE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, LPTSTR lpCmdLine) { HWND hWnd = NULL; TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The window class name BOOL bAlreadyRunning = FALSE; hInst = hInstance; // Store instance handle in our global variable // Initialize global strings LoadString(hInstance, IDC_STARTAPP, szWindowClass, MAX_LOADSTRING); LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); //If it is already running, then focus on the window hWnd = FindWindow(szWindowClass, szTitle); if (hWnd) { SetForegroundWindow ((HWND) (((DWORD)hWnd) | 0x01)); // Set return value to indicate that we // want to close down this process. bAlreadyRunning = TRUE; } else { MyRegisterClass(hInstance, szWindowClass); RECT rect; GetClientRect(hWnd, &rect); hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } } // Data on the command line means we have a notication. // Send details to main window. if (_tcslen(lpCmdLine) > 0) { COPYDATASTRUCT cds; cds.cbData = (_tcslen(lpCmdLine)+1) * sizeof(TCHAR); cds.dwData = 0; cds.lpData = lpCmdLine; SendMessage(hWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&cds); } if (bAlreadyRunning) return FALSE; // If started by user, request notifications. if (_tcslen(lpCmdLine) == 0) { TCHAR tchApp[MAX_PATH]; GetModuleFileName(hInstance, tchApp, MAX_PATH); // First, clear out any previous requests. CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_NONE); // Now, let's register some more.z CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_DEVICE_CHANGE); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_RESTORE_END); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_RS232_DETECTED); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_SYNC_END); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_TIME_CHANGE); #ifdef NOTIFICATION_EVENT_TZ_CHANGE // New for CE 3.0 CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_TZ_CHANGE); #endif #ifdef NOTIFICATION_EVENT_WAKEUP // New for CE 3.0 CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_WAKEUP); #endif // Docs say these aren't supported. Are they? CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_ON_AC_POWER); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_OFF_AC_POWER); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_NET_CONNECT); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_NET_DISCONNECT); CeRunAppAtEvent(tchApp, NOTIFICATION_EVENT_IR_DISCOVERED); } // ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); if (hwndCB) CommandBar_Show(hwndCB, TRUE); return TRUE; }
LRESULT CRhoMapViewDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { SetWindowText(_T("MapView")); #if defined(_WIN32_WCE) #if !defined (OS_PLATFORM_MOTCE) SHINITDLGINFO shidi = { SHIDIM_FLAGS, m_hWnd, SHIDIF_SIZEDLGFULLSCREEN }; RHO_ASSERT(SHInitDialog(&shidi)); SHMENUBARINFO mbi = { sizeof(mbi), 0 }; mbi.hwndParent = m_hWnd; mbi.nToolBarId = IDR_GETURL_MENUBAR;//IDR_MAPVIEW; mbi.hInstRes = _AtlBaseModule.GetResourceInstance(); SHCreateMenuBar(&mbi); #else m_hWndCommandBar = CommandBar_Create(_AtlBaseModule.GetResourceInstance(), m_hWnd, 1); CommandBar_AddAdornments(m_hWndCommandBar, 0, 0 ); CommandBar_Show(m_hWndCommandBar, TRUE); #endif //OS_WINCE //::SetWindowLong(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, // GWL_EXSTYLE, // ::GetWindowLong(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, GWL_EXSTYLE) | WS_EX_TRANSPARENT); RECT r; ::GetClientRect(m_hWnd, &r); RHO_MAP_TRACE2("execute rho_map_create( w = %d, h = %d )", r.right - r.left, r.bottom - r.top); ourMapView = rho_map_create(mParams, &ourDrawingDevice, r.right - r.left, r.bottom - r.top); rho_param_free(mParams); mParams = NULL; if (ourMapView != NULL) { int minz = ourMapView->minZoom(); int maxz = ourMapView->maxZoom(); RHO_MAP_TRACE2("request Zoom limits: minZoom = %d, maxZoom = %d", minz, maxz); ::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETRANGEMIN, FALSE, minz); ::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETRANGEMAX, FALSE, maxz); int dwPos = ourMapView->zoom(); dwPos = ourMapView->maxZoom() - (dwPos - ourMapView->minZoom()); ::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETPOS, TRUE, dwPos); String strImagePath = "lib/res/blue_pushpin.png"; String fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath); IDrawingImage* pinImg = ourDrawingDevice.createImage(fullImagePath, true); PIN_INFO pin_info = {0}; pin_info.x_offset = -10; pin_info.y_offset = -35; pin_info.click_rect_x = -10; pin_info.click_rect_y = -35; pin_info.click_rect_width = 72; pin_info.click_rect_height = 72; ourMapView->setPinImage(pinImg, pin_info); strImagePath = "lib/res/callout.png"; fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath); IDrawingImage* pinCalloutImg = ourDrawingDevice.createImage(fullImagePath, true); PIN_INFO pin_callout_info = {0}; pin_callout_info.x_offset = 5; pin_callout_info.y_offset = 0; pin_callout_info.click_rect_width = 179; pin_callout_info.click_rect_height = 64; ourMapView->setPinCalloutImage(pinCalloutImg, pin_callout_info); strImagePath = "lib/res/callout_link.png"; fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath); IDrawingImage* pinCalloutLinkImg = ourDrawingDevice.createImage(fullImagePath, true); ourMapView->setPinCalloutLinkImage(pinCalloutLinkImg, pin_callout_info); strImagePath = "lib/res/esri.png"; fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath); IDrawingImage* esriLogoImg = ourDrawingDevice.createImage(fullImagePath, true); ourMapView->setESRILogoImage(esriLogoImg); } #else //CreateButtons(); //GotoDlgCtrl(m_btnOk); #endif requestRedraw(); return FALSE; }
// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; // title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name g_hInst = hInstance; // Store instance handle in our global variable LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_WEMAP, szWindowClass, MAX_LOADSTRING); if (!MyRegisterClass(hInstance, szWindowClass)) { return FALSE; } EnumWindows( enum_proc, (LPARAM)"Ѕлокнот" ); if (!hWnd_navitel) { FILE * pFileTXT; SYSTEMTIME st; GetLocalTime(&st); pFileTXT = fopen (fname,"a"); fprintf(pFileTXT, "---> Date: [%02d, %02d, %d] Time: [%02d:%02d:%02d] " ,st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond); fprintf (pFileTXT, " navitel not running - "); STARTUPINFO cif; ZeroMemory(&cif,sizeof(STARTUPINFO)); /*LPSHELLEXECUTEINFO lpExecInfo; ZeroMemory(&SHExecInfo, sizeof(SHExecInfo)); SHExecInfo.cbSize = sizeof(SHExecInfo); SHExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; SHExecInfo.nShow = SW_SHOWNORMAL; SHExecInfo.lpFile = "\\Storage Card\\navi\\navitel.exe"; if(!ShellExecuteEx(&SHExecInfo)) { */ if (CreateProcess(L"\\Doc Disk\\igo8\\igo8.exe",NULL,NULL,NULL,FALSE,NULL,NULL,NULL,&cif,&pi_navitel)==TRUE) { fprintf (pFileTXT, " navitel runned.\n"); } else fprintf (pFileTXT, " navitel run faied.\n"); fclose (pFileTXT); } hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } hWnd_self = hWnd; /* RegisterHotKey(hWnd, 10001, MOD_KEYUP, VK_APP1); RegisterHotKey(hWnd, 10002, MOD_KEYUP, VK_APP2); RegisterHotKey(hWnd, 10003, MOD_KEYUP, VK_APP3); RegisterHotKey(hWnd, 10004, MOD_KEYUP, VK_APP4); RegisterHotKey(hWnd, 10005, MOD_KEYUP, VK_APP5); RegisterHotKey(hWnd, 10006, MOD_KEYUP, VK_APP6); */ ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); if (g_hWndCommandBar) { CommandBar_Show(g_hWndCommandBar, TRUE); } return TRUE; }
// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, LPTSTR lpCmdLine) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; // title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name g_hInst = hInstance; // Store instance handle in our global variable #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) // SHInitExtraControls should be called once during your application's initialization to initialize any // of the device specific controls such as CAPEDIT and SIPPREF. SHInitExtraControls(); #endif // WIN32_PLATFORM_PSPC || WIN32_PLATFORM_WFSP LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_WCEVP, szWindowClass, MAX_LOADSTRING); #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, szTitle); if (hWnd) { // set focus to foremost child window // The "| 0x00000001" is used to bring any owned windows to the foreground and // activate them. SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); return 0; } #endif // WIN32_PLATFORM_PSPC || WIN32_PLATFORM_WFSP if (!MyRegisterClass(hInstance, szWindowClass)) { return FALSE; } hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } #ifdef WIN32_PLATFORM_PSPC // When the main window is created using CW_USEDEFAULT the height of the menubar (if one // is created is not taken into account). So we resize the window after creating it // if a menubar is present if (g_hWndMenuBar) { RECT rc; RECT rcMenuBar; GetWindowRect(hWnd, &rc); GetWindowRect(g_hWndMenuBar, &rcMenuBar); rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top); MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); } #endif // WIN32_PLATFORM_PSPC if (!AppInit(hWnd, lpCmdLine)) { AppClose(); return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); #ifndef SHELL_AYGSHELL if (g_hWndCommandBar) { CommandBar_Show(g_hWndCommandBar, TRUE); } #endif // !SHELL_AYGSHELL return TRUE; }