开发者

Four WinAPI test questions

开发者 https://www.devze.com 2023-03-12 17:58 出处:网络
Following is an extraction of a WinAPI test quiz. I\'ve researched quite a bit, but haven\'t found the answers to these:

Following is an extraction of a WinAPI test quiz. I've researched quite a bit, but haven't found the answers to these:

    1. Which statement, regarding dynamic link libraries (DLL), is WRONG:
    a) DLLs can be used to exchange data between applications in Windows
    b) DLLs can call Windows modules
    c) DLLs can use DOS fil开发者_Go百科e functions
    d) DLLs can control a user dialog in Windows

    2. Which statement, regarding the messages in Windows, is WRONG:
    a) messages can be exchanged between the objects of an application
    b) messages can be generated when events happen
    c) messages can be exchanged between applications
    d) messages can be exchanged with the help of temporary queue storage

    3. Which statement, regarding the system message queue, is CORRECT:
    a) it serves for communication and exchange of messages between applications
    b) it serves for exchange of messages between common resources
    c) it serves for temporary storage of messages from the peripheral devices
    d) it serves for communication and exchange of messages between window objects

    4. In order to hide a window or a control, the following function is used:
    a) SetWindowHide
    b) HideWindow
    c) UnshowWindow
    d) DeleteWindow

I am absolutely positive question 4 is just wrong. The correct answer is ShowWindow.

And I'm almost certain that 2 does not have a correct answer at all.

I have no additional details or clarifications about the questions.


  • 1c. DLLs are mainly used to share common code but objects stored in them are only available locally within the memory space within which that instance of a DLL is currently mapped.
  • 2a. The answer to this one depends on your interpretation of the question. Strictly speaking you can. To send messages all you need is for the receiving end to have a window with a message loop to send to. For example WM_COPYDATA is 'sort of' used to exchange data between objects. If you view the receiving window as an 'object' and the sender (which does not need to be a window) to also be an 'object' then this does not hold.
  • 3d. Again as above it depends on your interpretation of 'object'. A message can be sent from an application that does not have a window.
  • 4.. None. You would either use SetWindowPos() or more commonly ShowWindow() with SW_HIDE
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号