Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window API Calls

Status
Not open for further replies.

Prophets

Programmer
Nov 5, 2003
14
CA
What I would like to know is How I know what to set the publc const to (see below) How do we know that the swp_showwindow = &H40

Where do we get the &H40?
_____________________________________

Public Const HWND_TOPMOST = -1
Public Const SWP_SHOWWINDOW = &H40
Public Const SWP_NOSIZE = &H2
 
Uh, not sure what you are asking?

&h40 is a hexadecimal number

DougP, MCP
 
I realize that it is Hex, but How do I know what to set these to? For Example: When using these with the SetWindowPos Function, How are the values of the const determined? This is an API Call, I am assuming they are set to a value pre-determined within the API. My Question is How do i know what they should be set to?

Public Const HWND_TOPMOST = -1
Public Const SWP_SHOWWINDOW = &H40
Public Const SWP_NOSIZE = &H2

Public Declare Sub SetWindowPos Lib "User32" _
(ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, _
ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

 
The Lib Files are almost all written in C, these are the values that are returned from the function - you need to read the documentation on the library file you calling to determing what the value being returned means.

Similiarly You can think of this like an error message that is returned in access. Each of those error values have a meaning. You can set a constant equalling those error values (and trap the errors), but you have to know what that error value (constant) means for you to make a meaningful named constant.

Just so you know, you can use any name for your constants when dealing with an API, it doesn't matter what the name of the variable being passed in, nor the variable name that is comparing to the resulting returned value.

the names of these constants are just meaningful to whomever wrote them, although they normally follow a naming practice that is descriptive.



Randall Vollen
National City Bank Corp.

Just because you have an answer - doesn't mean it's the best answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top