WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
 
Forum
Forum Rules Snippets forum rules

In this forum all the registered users may post their snippets of code they whish to share with the WinAsm Studio community following these basic rules:
* Only snippets of code are accepted in the topics of this forum.
* Discussions, suggestions, requests etc. must be posted in the "Discussions" topic.
* Do not post copyrighted material.
Administrators/moderators may edit, move or delete the entries that do not follow the preceding rules.

 

Single Instance, restrict the program running instances to one & if already running set the program to foreground.

blues
Quote Post


Member
******

Group: Members
Posts: 435
Member No.: 20
Joined: 20-May 04


with this code as program load point, you can restrict the program running instances to one (if already running, raises the program in foreground).

szDlgClass is a null terminated string with the name of the main dialog class.
WinMain is the win main proc (WinMain proc hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdShow:DWORD)

CODE
.code
start:
� �invoke FindWindow,offset szDlgClass,NULL
� �.if eax != NULL
� � � �push eax
� � � �invoke ShowWindow,eax,SW_SHOWNORMAL
� � � �pop �eax
� � � �invoke SetForegroundWindow,eax
� �.else
� � � �invoke GetModuleHandle,NULL
� � � �mov �hInstance,eax
� � � �invoke GetCommandLine
� � � �invoke WinMain, hInstance, NULL, eax, SW_SHOWDEFAULT
� �.endif
� �invoke ExitProcess,eax

Sponsored Links
PMEmail Poster
Top
owner_bsp
Quote Post


New Member
*

Group: Members
Posts: 19
Member No.: 29597
Joined: 3-December 09


Hey folks,

Im trying to dual box and really want octopus to toggle where it is sending key strokes rather than send them to all instances in wow. Is there a way for me to get the keypass thing simply send my keys to a single instance when toggled? It does this for the main instance when toggled off obviously... but I really want it working that way on a 2nd instance.
PMEmail PosterUsers WebsiteIntegrity Messenger IMICQAOLYahooMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topic

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian