home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / misc / 3399 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  2.4 KB

  1. Path: sparky!uunet!ogicse!flop.ENGR.ORST.EDU!flop.ENGR.ORST.EDU!usenet
  2. From: viswanm@jasper.CS.ORST.EDU (Mahesh Viswanathan)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: List of Tasks, or Modules
  5. Message-ID: <1dujniINN55j@flop.ENGR.ORST.EDU>
  6. Date: 12 Nov 92 21:52:50 GMT
  7. Article-I.D.: flop.1dujniINN55j
  8. Distribution: usa
  9. Organization: Computer Science Department, Oregon State University
  10. Lines: 74
  11. NNTP-Posting-Host: jasper.cs.orst.edu
  12.  
  13. Hi, 
  14.  
  15. I am fairly new to MS-Windows, and am programming under BC++ 3.1.
  16.  
  17. I have a question. I am trying to write a simple program that will
  18. let me use the left mouse button to CUT, and the right button
  19. to PASTE. I hate going up to the edit menu to do a Send, every time.
  20.  
  21. So, basically, this is what I want to do:
  22.  
  23. write a program that will look for the Terminal module, and if it
  24. exists, it will filter all mouse messages to that window, and
  25. substitute them with that, and the keystrokes for a CUT operation
  26. for the left button, and similarly a PASTE operation for the
  27. right button.
  28.  
  29. If this strategy is right, I have further problems.
  30. 1. When I try using the ModuleFirst/ModuleNext functions to find
  31. "Terminal", I don't get any listing of Modules at all!! And,
  32. it is the same thing if I do the TaskFirst/TaskNext thing.
  33. Here's the piece of code I am using......
  34.  
  35. ________________________________________________________________
  36.  
  37. long FAR PASCAL WndProc (HWND hWnd, WORD iMessage, WORD wParam,
  38.              LONG lParam)
  39.  
  40. <stuff deleted....>
  41. static MODULEENTRY meModule;
  42. static char szBuffer[40];
  43. static BOOL notalldone;
  44. static MODULEENTRY FAR* pmeModule = &meModule;
  45.  
  46. <stuff deleted....>
  47. switch (iMessage)
  48.     {
  49.     case WM_PAINT:
  50.  
  51.         hDC = BeginPaint(hWnd, &PtStr);
  52.         x = 1; y = 1;
  53.         notalldone = ModuleFirst(pmeModule);
  54.         while (notalldone)
  55.             {
  56.              wsprintf(szBuffer, "%s %d", meModule.szModule,
  57.                     meModule.hModule);
  58.              TextOut(hDC, x, y, meModule.szModule, 40);
  59.              y +=nYChar;
  60.              notalldone = ModuleNext(pmeModule)
  61.                     |  (y >= PtStr.rcPaint.bottom);
  62.             }
  63.  
  64.                                                                                         EndPaint(hWnd, &PtStr);
  65.         return 0;
  66.  
  67. <stuff deleted...>
  68.  
  69. __________________________________________________________________________
  70.  
  71.  
  72. Any pointers would be much appreciated. Also, since I don't read this
  73. newsgroup on a frequent basis (yet :-) ) , could you mail me a reply
  74. to 
  75. viswanm@research.cs.orst.edu?
  76.  
  77. Thanks!!
  78.  
  79. Mahesh
  80.  
  81.  
  82.  
  83. -- 
  84.     Mahesh Viswanathan        |    viswanm@research.cs.orst.edu
  85.     279B SE Lilly            |    (503)-752-0779
  86.     Corvallis OR 97333        |
  87.