win32 SetFocus问题

无忧老猪 2013-08-19 08:45:47
我在用win32 api写程序。
程序是单线程的,即只有WinMain函数这一个主线程。
我遇到的问题抽象描述如下:
程序的主窗口(即frame窗口)中,有两个子窗口A和B。
A中有一个子窗口C,他是一个标准的edit控件。
B中有一个子窗口D,他是我自己实现的一个窗口,功能类似于edit。
我在D窗口的WM_LBUTTONDOWN消息处理中,调用SetFocus,使得D能够响应键盘输入。
本来这一切都是正常的。
但问题是,如果鼠标点击一下窗口C的内部,使得C获得Focus。
然后,再点击窗口D的内部,无论如何点击,D都无法获得Focus了。
SetFocus(hwnd)之后, GetLastError返回值为5。

我已经检查了我调用SetFocus(hwnd)时传入的窗口句柄,句柄是完全正确的。
...全文
395 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
无忧老猪 2013-08-22
  • 打赏
  • 举报
回复
gfm688,你太牛了:)
gfm688 2013-08-22
  • 打赏
  • 举报
回复
其实点击窗口D的内部,D已经Focus了,估计是Caret在那个标准的edit控件KillFocus时被Destroy了,所以没法显示出来,正确的做法是:

  case   WM_SETFOCUS:
  {
    CreateCaret(hwnd, NULL, 1, cyChar);
    SetCaretPos(cur_data_len*cxChar, 0);
    ShowCaret(hwnd);
    return 0 ;
  }

  case   WM_KILLFOCUS:
  {
   HideCaret(hwnd);
   DestroyCaret();
   return 0 ;
  }
  case WM_LBUTTONDOWN:
  {
    SetFocus(hwnd);
    return 0;
  }
无忧老猪 2013-08-21
  • 打赏
  • 举报
回复
我把程序简化了一下,问题有点变化,但还是不正常。
只要点击一下frame上面的那个edit控件,我自己的窗口就无法获得光标了。

#include <windows.h>
#include <commctrl.h>

#define FAIL (-1)
#define SUCCESS (0)

HINSTANCE g_hInstance;
TCHAR szAppName[] = TEXT ("demo_app") ;


HWND hwnd_frame, hwnd_my_edit, hwnd_edit;

TCHAR szMyEditWinClassName[] = TEXT ("my_edit") ;
TEXTMETRIC textmetric;
int cxChar;
int cyChar;

char test_buf[2048] = "hello";

int cur_data_len=5;

LRESULT CALLBACK my_edit_WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;

switch (message)
{
case WM_CREATE:

hdc = CreateIC (TEXT("DISPLAY"), NULL, NULL, NULL) ;
SelectObject (hdc, GetStockObject(SYSTEM_FIXED_FONT)) ;
GetTextMetrics(hdc, &textmetric) ;
DeleteObject (SelectObject (hdc, GetStockObject(SYSTEM_FONT))) ;
DeleteDC (hdc) ;

cxChar = textmetric.tmAveCharWidth ;
cyChar = textmetric.tmHeight + textmetric.tmExternalLeading ;

CreateCaret(hwnd, NULL, cxChar, cyChar);

return 0 ;


case WM_PAINT :
hdc = BeginPaint (hwnd, &ps) ;
SelectObject (hdc, GetStockObject(SYSTEM_FIXED_FONT)) ;

TextOutA(hdc, 0, 0, test_buf, cur_data_len) ;

DeleteObject (SelectObject (hdc, GetStockObject(SYSTEM_FONT))) ;
EndPaint (hwnd, &ps) ;
return 0 ;

case WM_CHAR:
{
test_buf[cur_data_len]=wParam;
cur_data_len++;

SetCaretPos(cur_data_len*cxChar, 0);
InvalidateRect (hwnd, NULL, TRUE) ;
return 0 ;
}

case WM_SETFOCUS:
{
ShowCaret(hwnd);
return 0 ;
}

case WM_KILLFOCUS:
{
HideCaret(hwnd);
return 0 ;
}
case WM_LBUTTONDOWN:
{
SetFocus(hwnd);
SetCaretPos(cur_data_len*cxChar, 0);
ShowCaret(hwnd);
return 0;

}
}

return DefWindowProc (hwnd, message, wParam, lParam) ;
}

int register_my_edit_win()
{
WNDCLASS sub_wndclass;
sub_wndclass.style = CS_HREDRAW | CS_VREDRAW| CS_DBLCLKS;
sub_wndclass.lpfnWndProc= my_edit_WndProc;
sub_wndclass.cbClsExtra = 0;
sub_wndclass.cbWndExtra = 0;
sub_wndclass.hInstance = g_hInstance;
sub_wndclass.hIcon = LoadIcon (g_hInstance, IDI_APPLICATION);
sub_wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
sub_wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
sub_wndclass.lpszMenuName = NULL;
sub_wndclass.lpszClassName = szMyEditWinClassName;


if (!RegisterClass (&sub_wndclass))
{
MessageBox (NULL, TEXT ("Program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return FAIL;
}

return SUCCESS;

}

int reg_sys_win_classes()
{
INITCOMMONCONTROLSEX icex; // Structure for control initialization.
icex.dwSize = sizeof(icex);
icex.dwICC = ICC_STANDARD_CLASSES|ICC_BAR_CLASSES|ICC_TAB_CLASSES
|ICC_TREEVIEW_CLASSES|ICC_LISTVIEW_CLASSES;

InitCommonControlsEx(&icex);

}

TCHAR szFrameWinClassName[] = TEXT ("my_frame") ;
HWND hwnd_frame;

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
hwnd_edit = CreateWindow (TEXT("edit"), TEXT ("haha"),
WS_CHILD | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hwnd, NULL, g_hInstance, NULL) ;

hwnd_my_edit = CreateWindow (szMyEditWinClassName, NULL,
WS_CHILD | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hwnd, NULL, g_hInstance, NULL) ;
return 0 ;


case WM_SIZE:
MoveWindow(hwnd_edit, 0, 10, 100, 20, TRUE) ;
MoveWindow(hwnd_my_edit,0, 40, 600, 200, TRUE) ;
return 0 ;


case WM_CLOSE:
DestroyWindow (hwnd) ;
return 0 ;

case WM_DESTROY :
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}

int register_frame()
{
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc= WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = g_hInstance;
wndclass.hIcon = LoadIcon (g_hInstance, IDI_APPLICATION);
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szFrameWinClassName;

if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("Program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return FAIL;
}

return SUCCESS;

}

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{

MSG msg ;
HACCEL hAccel ;

g_hInstance = hInstance;

reg_sys_win_classes();
register_frame();
register_my_edit_win();

hwnd_frame = CreateWindow (szFrameWinClassName, szAppName,
WS_OVERLAPPEDWINDOW|WS_MAXIMIZE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, g_hInstance, NULL) ;

ShowWindow (hwnd_frame, SW_MAXIMIZE) ;
UpdateWindow (hwnd_frame) ;
;

while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}

return msg.wParam ;
}


Eleven 2013-08-21
  • 打赏
  • 举报
回复
你的代码里是怎么写的?
davidyu720 2013-08-21
  • 打赏
  • 举报
回复
贴一下代码。 或者参考http://stackoverflow.com/questions/9643536/setfocus-fails-with-a-valid-window-handle
fishion 2013-08-21
  • 打赏
  • 举报
回复
在D窗口中点击了就不需要调用SetFocus了
无忧老猪 2013-08-20
  • 打赏
  • 举报
回复
晕倒。在下的问题无人问津啊。
# -*- coding: utf-8 -*- ''' 事件传播有两种类型事件:基本事件和命令事件。它们不同于传播方式。事件传播是指事件从子部件 传到父部件和父窗口的父窗口等。基本事件不传播,命令事件传播。比如wx.CloseEvent是一个基本事件。 它没有传到父窗口的一样。默认情况下, 这种事件在一个事件处理器里就停止传播。如果想继续传播, 我们必须调用Skip()方法。 用event.Skip()方法调用事件默认处理程序 ''' import wx import threading from os.path import getsize def CompFile(win,file1,file2): try: if getsize(file1) != getsize(file2): win.m_staticText4.SetFont(win.font) win.m_staticText4.SetForegroundColour(wx.Colour(255,0,0)) win.m_staticText4.SetLabelText('文件比较结果:两个文件比较结果不一样') win.m_button4.SetFocus() win.m_button4.SetDefault() return f1=open(file1,'rb') f2=open(file2,'rb') except Exception as e: win.m_staticText4.SetFont(win.font) win.m_staticText4.SetForegroundColour(wx.Colour(255,0,255)) win.m_staticText4.SetLabelText('打开文件错误:'+e.strerror) win.m_button4.SetFocus() win.m_button4.SetDefault() else: for f11,f22 in zip(f1.read(),f2.read()): if f11 != f22: win.m_staticText4.SetFont(win.font) win.m_staticText4.SetForegroundColour(wx.Colour(255,0,0)) win.m_staticText4.SetLabelText('文件比较结果:两个文件比较结果不一样') win.m_button4.SetFocus() win.m_button4.SetDefault() return else: win.m_staticText4.SetFont(win.font) win.m_staticText4.SetForegroundColour(wx.Colour(0,155,0)) win.m_staticText4.SetLabelText('文件比较结果:两个文件比较结果一模一样') win.m_button4.SetFocus() win.m_button4.SetDefault() finally: try: f1.close() f1.close() except: pass class FileDrop(wx.FileDropTarget): def __init__(self, textctrl): wx.FileDropTarget.__init__(self) self.textctrl = textctrl def OnDropFiles(self, x, y, filePath): # 当文件被拖入grid后,会调用此方法 self.textctrl.SetValue(''.join(filePath)) return 1 class Mywin(wx.Dialog): def __init__(self,parent,title): super().__init__(parent,title=title,size=(500,200),style=wx.DEFAULT_FRAME_STYLE|wx.STAY_ON_TOP) self.InitUI() def InitUI(self): icon = wx.Icon('33.ico', wx.BITMAP_TYPE_ICO) self.SetIcon(icon) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) bSizer7 = wx.BoxSizer( wx.VERTICAL ) bSizer8 = wx.BoxSizer( wx.HORIZONTAL ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"第一个文件", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer8.Add( self.m_staticText2, 0, wx.ALL, 10 ) self.m_textCtrl3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl3.Bind(wx.EVT_TEXT_ENTER,self.onTextChange) self.fileDrop = FileDrop(self.m_textCtrl3) self.m_textCtrl3.SetDropTarget(self.fileDrop) bSizer8.Add( self.m_textCtrl3, 1, wx.ALL, 5 ) bSizer7.Add( bSizer8, 0, wx.EXPAND, 5 ) bSizer9 = wx.BoxSizer( wx.HORIZONTAL ) self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"第二个文件", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) bSizer9.Add( self.m_staticText3, 0, wx.ALL, 10 ) self.m_textCtrl4 = wx.TextCtrl( self, 5001, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.fileDrop1 = FileDrop(self.m_textCtrl4) self.m_textCtrl4.SetDropTarget(self.fileDrop1) bSizer9.Add( self.m_textCtrl4, 1, wx.ALL, 5 ) bSizer7.Add( bSizer9, 0, wx.EXPAND, 5 ) bSizer11 = wx.BoxSizer( wx.HORIZONTAL ) self.m_button4 = wx.Button( self, wx.ID_ANY, u"文件比较", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_button4.Bind(wx.EVT_BUTTON,self.OnButton) self.m_button4.SetFocus() self.m_button4.SetDefault() bSizer11.Add( self.m_button4, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_button5 = wx.Button( self, wx.ID_ANY, u"清空文本", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_button5.Bind(wx.EVT_BUTTON,self.OnClear) bSizer11.Add( self.m_button5, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer7.Add( bSizer11, 0, wx.ALIGN_CENTER|wx.ALIGN_LEFT, 5 ) bSizer12 = wx.BoxSizer( wx.VERTICAL ) self.font=wx.Font(16,wx.ROMAN,wx.NORMAL,wx.NORMAL) self.font.FaceName="微软雅黑" self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"文件比较结果:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText4.SetFont(self.font) self.m_staticText4.Wrap( -1 ) bSizer12.Add( self.m_staticText4, 0, wx.ALL, 5 ) bSizer7.Add( bSizer12, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer7 ) self.Layout() self.Bind(wx.EVT_CLOSE,self.onClose) self.Centre( wx.BOTH ) self.Show() def onTextChange(self,evt): self.m_button4.SetFocus() self.m_button4.SetDefault() def OnButton(self,event): file1=self.m_textCtrl3.GetValue() file2=self.m_textCtrl4.GetValue() t1=threading.Thread(target=CompFile,args=(self,file1,file2),name="CompFile") t1.start() self.m_staticText4.SetLabelText('正在比较文件请稍后!...') #CompFile(self,file1,file2) def OnClear(self,event): self.m_staticText4.SetForegroundColour(wx.Colour(0,0,0)) self.m_staticText4.SetLabelText('文件比较结果:') self.m_textCtrl3.SetValue('') self.m_textCtrl4.SetValue('') self.m_button4.SetFocus() self.m_button4.SetDefault() def onClose(self,e): self.Destroy() app=wx.App() Mywin(None,'文件比较') app.MainLoop()
VB6.0将窗体最小化到系统托盘区 控件法,才是最适合最方便的。使用已被微软封装好的控件:csystray1(名称可自定)。 可直接使用 SysTray.ocx 控件。也可用VB打开工程,做必要的话可作些改进(如更换图标、添加功能等),然后编译成ocx控件,可以随意命名。 注册控件方法: 32位系统的方法, 将ocx文件复制到c:\windows\system32下面, 运行命令regsvr32.exe Systray.ocx win7 64位系统的方法: 将ocx文件复制到c:\windows\syswow64下面, 运行命令c:\windows\syswow64\regsvr32.exe Systray.ocx 即可. vb中添加控件 ---------------------------------------------------------------------------------------------------------- 控件的属性和事件浅析: 该控件的InTray属性是用来设置是否显示在托盘中,True为显示在托盘,False为不显示; 该控件的TrayIcon属性是在托盘中显示的图标式样; 该控件的TrayTip属性是鼠标移动到该控件上面时,显示的提示文字; 该控件的重要事件是几个我们常用的鼠标事件:按下、放开、移动、双击,编程时就是利用这些事件达到在任务栏中控制程序的目的。 ------------------------------------------------------------------------------------------------------- 源代码如下: '使程序最小化时显示到系统托盘 Private Sub Form_Resize() If Me.WindowState = 1 Then '如程序为最小化则—— cSysTray1.InTray = True '隐藏到任务栏 Me.Visible = False '让程序界面不可见 End If End Sub '点击托盘图标后,让程序窗体显示出来 Private Sub CsysTray1_MouseDown(Button As Integer, Id As Long) Me.WindowState = 0 '程序回复到Normal状态 Me.Visible = True '从任务栏中清除图标 cSysTray1.InTray = False '令程序界面可见 Me.setfocus End Sub
WINAPI,WinAPI手册,最全的WINAPI函数手册,WINAPI开发必备 目录 1 内容简介 14 前言 14 第一章 Win32 API概论 14 为什么使用 Wiu32 API 14 Win32 API 简介 15 第二章 窗口管理函数 16 第一节 易用特性函数(Accessibility Features) 20 SoundSentryProc 20 SystemParametersinfo 21 第二节 按钮函数(Button) 34 CheckDlgButton 34 CheckRadioButton 34 IsDlgButtonChecked 35 第三节 插入标记(^)函数(Caret) 36 CreateCaret 36 DestroyCaret 37 GetCaretBlinkTime 37 GetCaretPos 38 HideCaret 38 SetCaretBlinkTime 39 SetCaretPos 39 ShowCaret 40 第四节 组合框函数(Combo box) 40 CCHookProc 40 CFHookProc 42 ChooseColor 43 ChooseFont 44 CommDlgExtendedEorror 45 DlgDirListComboBox 47 DlgDirSelectEx 49 DlgDirSelectComboBoxEx 50 FindText 50 FRHookProc 51 GetFileTitle 52 GetOpenFileName 53 GetSaveFileName 54 OFNGookProc 54 OFNHookProcOldStyle 56 PagePaintHook 57 PageSetupDlg 58 pageSetupHook 58 PrintDlg 59 PrintdlgEx 60 PrintHookProc 61 ReplaceText 62 SetupHookProc 63 第五节 标函数(Cursor) 64 ClipCursor 64 CopyCursor 65 CreateCursor 65 DestroyCursor 66 GetClipCursor 67 GetCursor 67 GetCursorpos 67 LoadCursorFromFile 68 SetCursor 68 SetCursorPos 69 SetSystemCursor 69 ShowCursor 70 LoadCursor 71 第六节 对话框函数(Dialog Box) 72 CreateDialog 72 CreateDialoglndirect 73 CreateDialoglndirectParam 74 CreateDialogParam 76 DefDlgProc 77 DialogBox 78 DialogBoxlndirect 79 DialogBoxlndirectParam 80 DialogBoxParam 81 DialogProc 82 EndDialog 83 GetDialogBaseUnits 83 GetDigCtrllD 84 GetDigltem 85 GetDlgltemlnt 85 GetDlgltemText 86 GetNextDlgGroupltem 87 GetNexTDlgTabltem 88 IsDialogMessage 88 MapDialogRect 89 MessageBox 90 MessageBoxEx 93 SendDlgltemMessage 94 SetDlgltemlnt 95 SetDlgltemText 95 MessageBoxlndirect 96 第七节 编辑控制函数(Edit Control) 97 EditWordBreakproc 97 第八节 图标函数(Icon) 98 Copylcon 98 Createlcon 99 CreatelconFromResource 100 CreatelconFromResourceEx 101 Destroylcon 102 Create_cpm_mdorect_ZIWe 102 Drawlcon 103 DrawlconEx 104 ExtractAssociatedlcon 105 Extractlcon 106 ExtractlconEx 106 Getlconlnfo 107 LookuplconldFromDirectory 108 LookuplconldFrom 109 Loadlcon 110 第九节 键盘加速器函数(Keyboard Accelerator) 110 CopyAcceleratorTable 111 CreateAcceleratorTable 111 DestroyAcceleratorTable 112 LoadAccelerators 112 TranslateAccelerator 113 第十节 键盘输入函数(Keyboard Input) 114 ActivateKeyboadLayout 114 EnableWindow 115 GetActiveWindows 116 GetAsyncKeyState 116 GetFocus 117 GetKBCodePage 118 GetKeyboardLayout 118 GetKeyboardLayoutList 118 GetKeyboardLayoutName 119 GetKeyboardState 119 GetKeyNameText 120 GetKeyState 121 IsWindowEnabled 122 keybd_event 122 LoadKeyboardLayout 123 MapVirtualKey 124 MapVlrtualKeyEx 126 OemKeyScan 126 RegisterHotKey 127 SetActiveWindow 128 SetFocus 129 SetKeyboardState 130 ToAscii 130 ToAsciiCxToAsciiCx 131 ToUnicode 132 ToUnicodeEx 133 UnloadKeyboardL 134 UnreglsterHotKey 134 VkKeyScan 135 vkKeyScanEx 136 第十一节 列表框函数(List boX) 136 DlgDirList 136 DlgDirSelectEx(2) 137 第十二节 菜单函数(Menu) 138 CheckMenuRadlol 138 CreateMenu 139 CreatePopupMenu 140 DeleteMenu 140 DestroyMenu 141 DrawMenuBar 141 EnableMenultem 142 GetMenu 143 GetMenuDefaultltem 143 GetMenultemlD 144 GetMenultemlnfo 144 GetMenultemRect 145 getSubMenu 145 GetSystemMenu 146 HlllteMenultem 147 InsertMenultem 147 IsMenu 148 LoadMenu 149 LoadMenulndirect 149 MenultemFromPo 150 RemoveMenu 150 SetMenu 151 SetMenuDefaultltem 151 SetMenultemBitm 152 SetMenultemlnfo 153 TrackPopupMenu 154 TrackPopupMenuEx 155 AppendMenu 156 CheckMenultem 159 GetMenuCheckMarkDimensions 159 GetMenuState 160 GetMenuString 161 InsertMenu 161 ModifyMenu 163 第十三节 消息和消息总队列函数(Message and Message Queue) 165 BroadcastSystemMessage 165 DispatchMessage 166 GetlnputState 167 GetMessage 167 GetMessageExtralnfo 168 GetMessagePos 168 GetMessageTime 169 GetQueueStatus 170 InSendMessage 171 InSendMessageEx 171 PeekMessage 172 PostMessage 173 PostQuitMessage 174 PostThreadMessage 175 RegisterWindowsMessage 176 ReplyMessage 176 SendAsyncProc 177 SendMessage 178 SendMessageCallback 178 SendMessageTImeout 179 SendNotifyMessage 181 SendMessageExtralnfo 181 TranslateMessage 182 WaltMessage 183 PostAppMessage 183 SetMessageQueue 183 第十四节 鼠标输入函数(Mouse Input) 183 DragDetect 183 GetCapture 184 GetDoubleCllckTime 184 GetMouseMovePoints 185 mouse_event 186 ReleaseCapture 188 SetCapture 188 SetDoubleCllckTime 189 SwapMouseButton 189 TrackMouseEvent 190 第十五节 多文档接口函数(Multiple Document Interface) 191 CreateMDIWindow 191 DefFrameProc 192 DefMDIChildProc 193 TranslateMdISysAccel 194 第十六节 资源函数(Resource) 195 BeginUpdateResource 195 CopyImage 195 EndUpdateResource 197 EnumResLangProc 197 EnumResNameProc 198 EnumResourceLanguages 199 EnumResourceNames 200 EnumResourceTypes 200 EnumResTypeProc 201 FlndResource 202 FindResourceEx 203 LoadImage 204 LoadResource 206 LockResource 207 SlzeofResource 207 UpdateResource 208 FreeResource 209 UnlockResource 209 第十七节 滚动条函数(Scroll Bar) 209 EnableScrollBar 209 GetScrolllnfo 210 ScrollDC 211 ScrollWindowEx 212 SetScrolllnfo 214 ShowScrollBar 215 GetScrollPos 215 GetScrollRange 216 ScrollWindow 217 SetScrollPos 218 SetScrollRange 219 第十八节 窗口函数(Window) 220 AdlustWindowRect 220 AdjustWindowRectEx 221 AnImateWindow 222 ArrangelconlcWindows 223 BeginDeferWindowPos 223 BromgWindowToTop 224 CascadeWindows 225 ChildWindowFromaPoint 225 ChildWindowFromaPointEx 226 CloseWindow 227 Create Window 227 CreateWindowEx 233 DeferWindowPos 235 DestroyWindow 238 EnableWindow 238 EndDeferWindowPos 239 EnumChildProc 240 EnumTreadWindows 240 EnumThreadWndProc 241 EnumWindows 241 EnumWindowsProc 242 FindWindow 243 FlndWindowEx 243 GetClientRect 244 GetDesktopWindow 244 GetForegroundWindow 245 GetLastActivePopup 245 GetNextWindow 246 GetParent 246 GetTopWindow 247 GetWindow 247 GetWindowPlacement 248 GetWindowRect 249 GetWindowText 249 IsChild 250 GetWindowTextLength 251 GetWlndowThreadprocessld 251 IsIconic 252 IsWindow 252 IsWindowUnicode 253 IsWindowVlslble 253 IsZoomed 254 MoveWindow 254 Openlcon 255 SetForegroundWindow 255 SetParent 256 SetWindowLong 256 SetWindowPlacement 259 SetWindowPos 260 SetWindowText 263 ShowOwnedPopups 263 ShowWindow 264 ShowWindowAsync 265 TileWindows 266 WindowFromPoint 267 WinMain 267 AnyPopup 269 EnumTaskWindows 269 GetSysModalWindow 269 GetWindowTask 269 SetSysModalWindow 269 第十九节 窗口类函数(Window Class) 270 GetClasslnfoEx 270 GetClassLong 270 GetClassName 271 GetWindowLong 272 RegisterClassEx 273 SetClassLong 274 SetWindowLong 275 GetClasslnfoEx 278 GetClassWord 279 GetWindowWord 279 RegisterClass 279 SetClassWord 280 SetWindowWord 281 第二十节 窗口过程函数(Window Procedure) 281 CallWindowProc 281 DefWindowProc 282 WindowProc 283 第二十一节 窗口属性函数(Window Property) 284 EnumProps 284 EnumPropsEx 284 GetProp 285 PropEnumProcEx 285 RemoveProp 286 SetProp 287
Creating Windows CreateMDIWindow CreateWindow CreateWindowEx RegisterClass RegisterClassEx UnregisterClass Message Processing BroadcastSystemMessage CallNextHookEx CallWindowProc DefFrameProc DefMDIChildProc DefWindowProc DispatchMessage GetMessage GetMessageExtraInfo GetMessagePos GetMessageTime GetQueueStatus InSendMessage PeekMessage PostMessage PostQuitMessage PostThreadMessage RegisterWindowMessage ReplyMessage SendMessage SendMessageCallback SendMessageTimeout SendNotifyMessage SetMessageExtraInfo SetWindowsHookEx TranslateMessage UnhookWindowsHookEx WaitMessage Window Information AnyPopup ChildWindowFromPoint ChildWindowFromPointEx EnableWindow EnumChildWindows EnumPropsEx EnumThreadWindows EnumWindows FindWindow FindWindowEx GetClassInfoEx GetClassLong GetClassName GetClientRect GetDesktopWindow GetFocus GetForegroundWindow GetNextWindow GetParent GetProp GetTopWindow GetWindow GetWindowLong GetWindowRect GetWindowText GetWindowTextLength IsChild IsIconic IsWindow IsWindowEnabled IsWindowUnicode IsWindowVisible IsZoomed RemoveProp SetActiveWindow SetClassLong SetFocus SetForegroundWindow SetParent SetProp SetWindowLong SetWindowText WindowFromPoint Processes and Threads CreateEvent CreateMutex CreateProcess CreateSemaphore CreateThread DeleteCriticalSection DuplicateHandle EnterCriticalSection ExitProcess ExitThread GetCurrentProcess GetCurrentProcessId GetCurrentThread GetCurrentThreadId GetExitCodeProcess GetExitCodeThread GetPriorityClass GetThreadPriority GetWindowThreadProcessId InitializeCriticalSection InterlockedDecrement InterlockedExchange InterlockedIncrement LeaveCriticalSection OpenEvent OpenMutex OpenProcess OpenSemaphore PulseEvent ReleaseMutex ReleaseSemaphore ResetEvent ResumeThread SetEvent SetPr

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧