一个小问题:)(50分)

  • 主题发起人 主题发起人 浮生
  • 开始时间 开始时间

浮生

Unregistered / Unconfirmed
GUEST, unregistred user!
postmessage(hwnd,WM_KEYDOWN,$D,$1c0001);<br>postmessage(hwnd,WM_KEYUP,$d,$c01c0001);<br>中$D,及$1c0001,$c01c0001是什么意思。<br>谢谢:)
 
十六进制的数字!
 
呵呵,看帮助嘛<br>PostMessage<br>The PostMessage function places (posts) a message in the message queue associated with the thread that created the specified window and then returns without waiting for the thread to process the message. Messages in a message queue are retrieved by calls to the GetMessage or PeekMessage function. <br><br>BOOL PostMessage(<br>&nbsp; HWND hWnd, &nbsp; &nbsp; &nbsp;// handle of destination window<br>&nbsp; UINT Msg, &nbsp; &nbsp; &nbsp; // message to post<br>&nbsp; WPARAM wParam, &nbsp;// first message parameter<br>&nbsp; LPARAM lParam &nbsp; // second message parameter<br>);<br>&nbsp;<br>Parameters<br>hWnd <br>Handle to the window whose window procedure is to receive the message. Two values have special meanings: Value Meaning <br>HWND_BROADCAST The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows. <br>NULL The function behaves like a call to PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread. <br><br><br>Msg <br>Specifies the message to be posted. <br>wParam <br>Specifies additional message-specific information. <br>lParam <br>Specifies additional message-specific information. <br>Return Values<br>If the function succeeds, the return value is nonzero.<br><br>If the function fails, the return value is zero. To get extended error information, callGetLastError. <br>
 
BOOL PostMessage(<br>&nbsp; &nbsp; HWND hWnd, // handle of destination window<br>&nbsp; &nbsp; UINT Msg, // message to post <br>&nbsp; &nbsp; WPARAM wParam, // first message parameter<br>&nbsp; &nbsp; LPARAM lParam // second message parameter<br>&nbsp; &nbsp;);<br>$ 带表十六进制的数据<br>$d 那是第一个参数<br>$c01c0001 是第二个参数<br>想知道这两个参数,有什么意义吗?<br>去查win32 SDK 有很详细的说明。<br>查 WM_KEYDOWN &nbsp;,就会看到下面的东西 :)<br>我的E文不太好,你自己搞掂吧。<br>WM_KEYDOWN &nbsp;<br>nVirtKey = (int) wParam; &nbsp; &nbsp;// virtual-key code <br>lKeyData = lParam; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// key data <br>&nbsp;<br><br>Parameters<br><br>nVirtKey<br><br>Value of wParam. Specifies the virtual-key code of the nonsystem key. <br><br>lKeyData<br><br>Value of lParam. Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table: <br><br>Value Description<br>0-15 Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user holding down the key.<br>16-23 Specifies the scan code. The value depends on the original equipment manufacturer (OEM).<br>24 Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.<br>25-28 Reserved; do not use.<br>29 Specifies the context code. The value is always 0 for a WM_KEYDOWN message.<br>30 Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.<br>31 Specifies the transition state. The value is always 0 for a WM_KEYDOWN message.<br><br>
 
多人接受答案了。
 
后退
顶部