Run only one instance of your application: Difference between revisions
Run only one instance of your application (view source)
Revision as of 18:22, 8 June 2008
, 8 June 2008no edit summary
Hellboy1975 (talk | contribs) No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
In the SRC file within the panel object put this piece of code: | In the SRC file within the panel object put this piece of code: | ||
< | <source lang="vdf"> | ||
Procedure Exit_Application | Procedure Exit_Application | ||
integer iVoid | integer iVoid | ||
Line 18: | Line 18: | ||
Forward Send Exit_Application | Forward Send Exit_Application | ||
End_Procedure | End_Procedure | ||
</ | </source> | ||
And in a package that gets hit on startup: | And in a package that gets hit on startup: | ||
< | <source> | ||
// Constants | // Constants | ||
Define ERROR_INVALID_HANDLE for 6 // taken from error.h of VS7 | Define ERROR_INVALID_HANDLE for 6 // taken from error.h of VS7 | ||
Line 54: | Line 55: | ||
// create the mutex | // create the mutex | ||
Send Create_MuteX_Object | Send Create_MuteX_Object | ||
</ | </source> | ||
=== Using FindWindow WinAPI === | === Using FindWindow WinAPI === | ||
Line 61: | Line 62: | ||
Usage in SRC: | Usage in SRC: | ||
< | <source> | ||
Use myPanel,pkg | Use myPanel,pkg | ||
Object Main is a myPanel | Object Main is a myPanel | ||
</ | </source> | ||
Source myPanel.pkg | Source myPanel.pkg | ||
< | <source> | ||
//////////////////////////////////////////// | //////////////////////////////////////////// | ||
// | // | ||
Line 104: | Line 105: | ||
End_Procedure // End_Construct_Object | End_Procedure // End_Construct_Object | ||
End_class | End_class | ||
</ | </source> | ||
The FindWindow technique is also discussed in the book [http://www.starzen.com/Products/DataFlexVDF/Books/tabid/56/Default.aspx Mastering Visual DataFlex] from Starzen. | The FindWindow technique is also discussed in the book [http://www.starzen.com/Products/DataFlexVDF/Books/tabid/56/Default.aspx Mastering Visual DataFlex] from Starzen. | ||
[[Category: Tutorials]] | [[Category: Tutorials]] |