为什么弹出关于对话框后,小弟我的编辑框就不能接收输入了
为什么弹出关于对话框后,我的编辑框就不能接收输入了?
#include <windows.h>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#include "resource.h "
static HWND hEdit;
LRESULT CALLBACK WndProc
( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
LRESULT CALLBACK WndEditProc
( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
WNDPROC EditOldProc;
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
WNDCLASS wc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)::GetStockObject(COLOR_BTNFACE);
wc.hCursor=::LoadCursor(NULL,IDC_ARROW);
wc.hInstance=hInstance;
wc.lpfnWndProc=WndProc;
wc.lpszClassName=TEXT( "EmhPod ");
wc.lpszMenuName=MAKEINTRESOURCE(IDR_MENU1);
wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_ICON1));
wc.style=CS_HREDRAW | CS_VREDRAW;
if(!RegisterClass(&wc))
{
::MessageBox(NULL,TEXT( "窗口注册失败 "),TEXT( "提示 "),MB_OK);
}
HWND hwnd=::CreateWindow(TEXT( "EmhPod "),TEXT( "超级记事本1.0版 "),WS_OVERLAPPEDWINDOW ,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;
::ShowWindow(hwnd,nCmdShow);
::UpdateWindow(hwnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam;
}
LRESULT CALLBACK WndProc
( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rc;
RECT rcEdit;
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HANDLE hf; // file handle
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
//
// Set lpstrFile[0] to '\0 ' so that GetOpenFileName does not
// use the contents of szFile to initialize itself.
#include <windows.h>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#include "resource.h "
static HWND hEdit;
LRESULT CALLBACK WndProc
( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
LRESULT CALLBACK WndEditProc
( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
WNDPROC EditOldProc;
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
WNDCLASS wc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)::GetStockObject(COLOR_BTNFACE);
wc.hCursor=::LoadCursor(NULL,IDC_ARROW);
wc.hInstance=hInstance;
wc.lpfnWndProc=WndProc;
wc.lpszClassName=TEXT( "EmhPod ");
wc.lpszMenuName=MAKEINTRESOURCE(IDR_MENU1);
wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_ICON1));
wc.style=CS_HREDRAW | CS_VREDRAW;
if(!RegisterClass(&wc))
{
::MessageBox(NULL,TEXT( "窗口注册失败 "),TEXT( "提示 "),MB_OK);
}
HWND hwnd=::CreateWindow(TEXT( "EmhPod "),TEXT( "超级记事本1.0版 "),WS_OVERLAPPEDWINDOW ,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;
::ShowWindow(hwnd,nCmdShow);
::UpdateWindow(hwnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam;
}
LRESULT CALLBACK WndProc
( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rc;
RECT rcEdit;
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HANDLE hf; // file handle
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
//
// Set lpstrFile[0] to '\0 ' so that GetOpenFileName does not
// use the contents of szFile to initialize itself.