what's hwnd ?
what's hinstance?
and what difference between them?
what's hwnd ?
what's hinstance?
and what difference between them?
> what's hwnd ?
A handle to a window.
> what's hinstance?
A handle to the running instance of a program.
> and what difference between them?
What's the difference between apples and pears?
Ess
Like a rat in a maze who says,
"Watch me choose my own direction"
Are you under the illusion
The path is winding your way? - Rush
i dont understand could you be more specify?
Just think of it like this;
hwnd is a common implementation of the type HWND (as described in windows.h) that gives a handle to a window. It is used to identify and work with specific windows be they dialog boxes, main windows or controls (all of these are technically windows). So when you want to do something specific with a window, you will address it through hwnd.
hinstance is of the type HINSTANCE and is passed to your program by the operating system via WinMain. This represents the "instance" of your program when it runs. With Windows (the operating system) you can often have multiple copies of your program running at once. Picture this as a specific identifier for your program while it’s running. You need this variable for a whole host of functions, for instance if you use CreateWindow() you will need to pass hinstance to create a window. Incidentally this specific function will then give you a hwnd.
To really learn more you should get Programming Windows by Charles Petzold
so hinstance is a handle to my window and hwnd is a handle to other windows?
>>so hinstance is a handle to my window and hwnd is a handle to other windows?
No it relates to the whole program.
See Petzold
hwnd and hinstance are a handle to my window so are the same?
You misunderstood. Like Fordy said, since Windows can have more than one copy of your program running, hinstance is a handle to the instance of your program. Sort of an identifier for your program.
hwnd is just a handle to a window.
-Govtcheez
[email protected]
so hwnd is a handle to my window and hinstance is handle to all the program
and how the SetTimer() function work every how much time i tell it to work without a loop?