Patrice Terrier
Using STATIC variables within a procedure June 24, 2009 03:19PM |
PROCEDURE SetStaticValue(LOCAL sUseString is string, LOCAL nValue is int) sUseString += "|" nhMain is int = Handle(MyWindow..Name) nStaticHandle is int = GetDlgItem(nhMain, ID_STATIC) IF nStaticHandle = 0 THEN nStaticHandle = API("USER32", "CreateWindowExA", 0, "LISTBOX", "", WS_CHILD + LBS_HASSTRINGS, 0, 0, 0, 0, nhMain, ID_STATIC, Instance, 0) END IF nStaticHandle THEN nIndex is int = SendMessage(nStaticHandle, 399, -1, &sUseString) IF nIndex > -1 THEN // We found same static SendMessage(nStaticHandle, 410, nIndex, nValue) ELSE // Add it to our static list SendMessage(nStaticHandle, 410, SendMessage(nStaticHandle, 384, 0, &sUseString), nValue) END END
FUNCTION GetStaticValue(LOCAL sUseString is string) sUseString += "|" nValue is int = 0 nhMain is int = Handle(MyWindow..Name) nStaticHandle is int = GetDlgItem(nhMain, ID_STATIC) IF nStaticHandle THEN nIndex is int = SendMessage(nStaticHandle, 399, -1, &sUseString) IF nIndex > -1 THEN // We found it nValue = SendMessage(nStaticHandle, 409, nIndex, 0) END END RESULT nValue
Hristo Dimitrov
Re: Using STATIC variables within a procedure December 10, 2010 12:02PM |
Hristo Dimitrov
Re: Using STATIC variables within a procedure December 10, 2010 12:06PM |
Patrice Terrier
Re: Using STATIC variables within a procedure December 10, 2010 12:26PM |
Hristo Dimitrov
Re: Using STATIC variables within a procedure December 10, 2010 12:59PM |
Patrice Terrier
Re: Using STATIC variables within a procedure December 10, 2010 01:45PM |
Jimbo
Re: Using STATIC variables within a procedure December 27, 2010 07:30AM |
Moderator |
Patrice Terrier
Re: Using STATIC variables within a procedure December 27, 2010 09:24AM |