The MASM Forum

General => The Campus => Topic started by: Ar0n on September 02, 2014, 06:38:53 AM

Title: Simple question about HWND
Post by: Ar0n on September 02, 2014, 06:38:53 AM
Hello guys, I have a simple question about window handles, can window handles changing in runtime? / Is it safe to store the HWND value of any window in a variable for later use?   that's :) thanks.
Title: Re: Simple question about HWND
Post by: dedndave on September 02, 2014, 07:08:30 AM
if window creation is successful, the handle is valid until the window is destroyed
it is common practice to store window and control handles in "permanent" (global) memory for access by other procedures
Title: Re: Simple question about HWND
Post by: Ar0n on September 02, 2014, 07:12:27 AM
Quote from: dedndave on September 02, 2014, 07:08:30 AM
if window creation is successful, the handle is valid until the window is destroyed
it is common practice to store window and control handles in "permanent" (global) memory for access by other procedures
thank you dedndave, just want to know if it's 100% safe.
Title: Re: Simple question about HWND
Post by: RuiLoureiro on September 03, 2014, 02:12:23 AM
If the memory fails, it is only ...% safe ! No ?  :biggrin:
Title: Re: Simple question about HWND
Post by: dedndave on September 03, 2014, 03:25:31 AM
well - it's safe in single-threaded models   :P