[Solved] How to create multiplethreads each with different ThreadProc() function using CreateThread()

Try this: DWORD WINAPI ThreadProc1( LPVOID lpParameter) { … return 0 ; } DWORD WINAPI ThreadProc2( LPVOID lpParameter) { … return 0 ; } … typedef DWORD (WINAPI * THREADPROCFN)(LPVOID lpParameter); THREADPROCFN fntable[4] = {ThreadProc1, ThreadProc2, …} ; //Start the threads for (int i = 0; i < max_number; i++) { DWORD ThreadId ; CreateThread( … Read more

[Solved] stopping a thread in windows [closed]

Using the TerminateThread function. The function you posted does: PostThreadMessage(hookThreadId, WM_QUIT, (WPARAM) NULL, (LPARAM) NULL); WaitForSingleObject(hookThreadHandle, 5000); So it sends a quit message to that thread, and then waits for it to close. 6 solved stopping a thread in windows [closed]

[Solved] How to replace several characters on a single string to desired characters (java)?

public class TranslateChar { /** @param args */ public static void main(final String[] args) { final Map<Character, Character> mapCharCod = new HashMap<>(36); final Map<Character, Character> mapCharDecod = new HashMap<>(36); mapCharCod.put(‘A’, ‘Z’); mapCharCod.put(‘B’, ‘X’); mapCharCod.put(‘C’, ‘Y’); mapCharDecod.put(‘Z’, ‘A’); mapCharDecod.put(‘X’, ‘B’); mapCharDecod.put(‘Y’, ‘C’); final String toCod = “CAB”; StringBuilder sb = new StringBuilder(“{“); for (final char c … Read more