elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Tutorial básico de Quickjs


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  [?] Alguien que pueda optimizar y arreglar este codigo
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [?] Alguien que pueda optimizar y arreglar este codigo  (Leído 2,771 veces)
MeCraniDOS


Desconectado Desconectado

Mensajes: 337


Sr. Glass


Ver Perfil
[?] Alguien que pueda optimizar y arreglar este codigo
« en: 2 Agosto 2013, 01:40 am »

Hola, a ver, tengo esta super chapuza de código pero no se por donde meterle mano para arreglarlo y que haga lo que yo quiero, y aunque parezca mentira, el código compila sin errores  :¬¬ :¬¬

Archivo main.cpp

Código
  1. #define _WIN32_WINNT 0x0500 //INPUT
  2. #define _WIN32_IE 0x0600
  3.  
  4. #define ICON_ID 100
  5. #define SYSTRAY_MSG 101
  6.  
  7.  
  8. #include <windows.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <time.h>
  12. #include <iostream>
  13.  
  14.  
  15. #include "SysTray.h"
  16. #include "SysTray_cpp.h"
  17. #include "Definiciones.h"
  18.  
  19. using namespace std;
  20.  
  21.  
  22. int main()
  23. {
  24.     HWND hWnd;
  25.  
  26.     SysTray SysT(ICON_ID, hWnd, SYSTRAY_MSG);
  27.  
  28.     SysT.SetInSysTray ( "I'm in the SysTray!", LoadIcon ( GetModuleHandle ( NULL ), MAKEINTRESOURCE ( ID_ICON ) ) );
  29.  
  30.     SysT.ShowBalloon("Hola","Pruebaaaa", 3);
  31.  
  32.     Activar_Icono(0,0,0,0);
  33.  
  34.  
  35.     /**
  36.  
  37.      0 = Sin Icono
  38.      1 = Informacion
  39.      2 = Alerta
  40.      3 = Error
  41.  
  42.      **/
  43.  
  44.     return 0;
  45.  
  46.  
  47. }
  48.  

Archivo SysTray.cpp

Código
  1. #define _WIN32_IE 0x0500
  2.  
  3. #include <windows.h>
  4.  
  5. #include "SysTray.h"
  6.  
  7. // Constructer, sets values passed by the parameters
  8. SysTray::SysTray ( int ID, HWND hWnd, int Message )
  9. {
  10. _id = ID; // Set the id for the icon
  11. _hWnd = hWnd; // The handle to the window
  12. _message = Message; // The message sent to the window procedure when something happends
  13. }
  14.  
  15. // Function to set the application in the SysTray
  16. BOOL SysTray::SetInSysTray ( char* ToolTip, HICON hIcon )
  17. {
  18. NOTIFYICONDATA nid;
  19.  
  20. nid.uID = _id; // Id for the icon
  21. nid.cbSize = sizeof ( NOTIFYICONDATA ); // Size of structure
  22. nid.hWnd = _hWnd; // Handle to the window
  23. nid.uFlags = NIF_MESSAGE|NIF_TIP|NIF_ICON; // Options
  24. nid.hIcon = hIcon; // The icon
  25. nid.uCallbackMessage = _message; // The message
  26.  
  27. lstrcpyn ( nid.szTip, ToolTip, sizeof ( nid.szTip ) ); // The tooltip
  28.  
  29. return Shell_NotifyIcon ( NIM_ADD, &nid ); // Add in the SysTray
  30. }
  31.  
  32. // Function to remove the application in the SysTray
  33. BOOL SysTray::RemoveFromSysTray ()
  34. {
  35. NOTIFYICONDATA nid;
  36.  
  37. nid.uID = _id; // Id for the icon
  38. nid.cbSize = sizeof ( NOTIFYICONDATA ); // Size of structure
  39. nid.hWnd = _hWnd; // Handle to the window
  40.  
  41. return Shell_NotifyIcon ( NIM_DELETE, &nid ); // Delete the icon
  42. }
  43.  
  44. // Show a tooltip balloon
  45. BOOL SysTray::ShowBalloon ( char* Title, char* Message, int Icon )
  46. {
  47. NOTIFYICONDATA nid;
  48.  
  49. nid.cbSize = sizeof ( NOTIFYICONDATA ); // Size of structure
  50. nid.hWnd = _hWnd; // Handle to parent window
  51. nid.uID = _id; // Id of the icon
  52. nid.uFlags = NIF_INFO; // Options: show balloon
  53. nid.dwInfoFlags = Icon;                                             // Icon for the balloon
  54. nid.uTimeout = 1000;    // Timeout when the balloon dissapear
  55.  
  56. lstrcpyn ( nid.szInfo, Message, sizeof ( nid.szInfo ) ); // Message
  57. lstrcpyn ( nid.szInfoTitle, Title, sizeof ( nid.szInfoTitle ) ); // Title
  58.  
  59. return Shell_NotifyIcon ( NIM_MODIFY, &nid ); // Show balloon
  60. }

Archivo SysTray.h

Código
  1. #ifndef _SYSTRAY_H_
  2. #define _SYSTRAY_H_
  3.  
  4. #include <windows.h>
  5.  
  6. // Extra messages for the balloon
  7.  
  8. #ifndef NIN_BALLOONSHOW // Send when the balloon is shown
  9. #define NIN_BALLOONSHOW WM_USER + 2
  10. #endif
  11.  
  12. #ifndef NIN_BALLOONHIDE // When the balloon is hide ( when you press the X button )
  13. #define NIN_BALLOONHIDE WM_USER + 3
  14. #endif
  15.  
  16. #ifndef NIN_BALLOONTIMEOUT // Whe the balloon dissapear
  17. #define NIN_BALLOONTIMEOUT WM_USER + 4
  18. #endif
  19.  
  20. #ifndef NIN_BALLOONUSERCLICK // When the user clicks on the balloon
  21. #define NIN_BALLOONUSERCLICK WM_USER + 5
  22. #endif
  23.  
  24. class SysTray
  25. {
  26. public:
  27. SysTray ( int ID, HWND hWnd, int Message );
  28. BOOL SetInSysTray ( char* ToolTip, HICON hIcon );
  29. BOOL RemoveFromSysTray ();
  30. BOOL ShowBalloon ( char* Title, char* Message, int Icon );
  31. private:
  32. int _message;
  33. int _id;
  34. HWND _hWnd;
  35. };
  36.  
  37. #endif
  38.  

Archivo SysTray_cpp.h

Código
  1. // SysTrayDemo.cpp : Defines the entry point for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Definiciones.h"
  6.  
  7. #define MAX_LOADSTRING 100
  8. #define WM_USER_SHELLICON WM_USER + 1
  9.  
  10. // Global Variables:
  11. HINSTANCE hInst; // current instance
  12. NOTIFYICONDATA nidApp;
  13. HMENU hPopMenu;
  14. TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
  15. TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
  16. TCHAR szApplicationToolTip[MAX_LOADSTRING];    // the main window class name
  17. BOOL bDisable = FALSE; // keep application state
  18.  
  19. // Forward declarations of functions included in this code module:
  20. ATOM MyRegisterClass(HINSTANCE hInstance);
  21. BOOL InitInstance(HINSTANCE, int);
  22. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  23.  
  24. int APIENTRY Activar_Icono(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
  25. {
  26. UNREFERENCED_PARAMETER(hPrevInstance);
  27. UNREFERENCED_PARAMETER(lpCmdLine);
  28.  
  29. // TODO: Place code here.
  30. MSG msg;
  31. HACCEL hAccelTable;
  32.  
  33. // Initialize global strings
  34. //LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
  35. LoadString(hInstance, IDC_SYSTRAYDEMO, szWindowClass, MAX_LOADSTRING);
  36.  
  37. MyRegisterClass(hInstance);
  38.  
  39. // Perform application initialization:
  40. if (!InitInstance (hInstance, nCmdShow))
  41. {
  42. return FALSE;
  43. }
  44.  
  45. hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SYSTRAYDEMO));
  46.  
  47. // Main message loop:
  48. while (GetMessage(&msg, NULL, 0, 0))
  49. {
  50. if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
  51. {
  52. TranslateMessage(&msg);
  53. DispatchMessage(&msg);
  54. }
  55. }
  56.  
  57. return (int) msg.wParam;
  58. }
  59.  
  60.  
  61.  
  62. //
  63. //  FUNCTION: MyRegisterClass()
  64. //
  65. //  PURPOSE: Registers the window class.
  66. //
  67. //  COMMENTS:
  68. //
  69. //    This function and its usage are only necessary if you want this code
  70. //    to be compatible with Win32 systems prior to the 'RegisterClassEx'
  71. //    function that was added to Windows 95. It is important to call this function
  72. //    so that the application will get 'well formed' small icons associated
  73. //    with it.
  74. //
  75. ATOM MyRegisterClass(HINSTANCE hInstance)
  76. {
  77. WNDCLASSEX wcex;
  78.  
  79. wcex.cbSize = sizeof(WNDCLASSEX);
  80.  
  81. wcex.style = CS_HREDRAW | CS_VREDRAW;
  82. wcex.lpfnWndProc = WndProc;
  83. wcex.cbClsExtra = 0;
  84. wcex.cbWndExtra = 0;
  85. wcex.hInstance = hInstance;
  86. wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SYSTRAYDEMO));
  87. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
  88. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
  89. wcex.lpszMenuName = MAKEINTRESOURCE(IDC_SYSTRAYDEMO);
  90. wcex.lpszClassName = szWindowClass;
  91. wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
  92.  
  93. return RegisterClassEx(&wcex);
  94. }
  95.  
  96. //
  97. //   FUNCTION: InitInstance(HINSTANCE, int)
  98. //
  99. //   PURPOSE: Saves instance handle and creates main window
  100. //
  101. //   COMMENTS:
  102. //
  103. //        In this function, we save the instance handle in a global variable and
  104. //        create and display the main program window.
  105. //
  106. BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
  107. {
  108.   HWND hWnd;
  109.   HICON hMainIcon;
  110.  
  111.   hInst = hInstance; // Store instance handle in our global variable
  112.  
  113.   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
  114.      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
  115.  
  116.   if (!hWnd)
  117.   {
  118.      return FALSE;
  119.   }
  120.  
  121.   hMainIcon = LoadIcon(hInstance,(LPCTSTR)MAKEINTRESOURCE(IDI_SYSTRAYDEMO));
  122.  
  123.   nidApp.cbSize = sizeof(NOTIFYICONDATA); // sizeof the struct in bytes
  124.   nidApp.hWnd = (HWND) hWnd;              //handle of the window which will process this app. messages
  125.   nidApp.uID = IDI_SYSTRAYDEMO;           //ID of the icon that willl appear in the system tray
  126.   nidApp.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; //ORing of all the flags
  127.   nidApp.hIcon = hMainIcon; // handle of the Icon to be displayed, obtained from LoadIcon
  128.   nidApp.uCallbackMessage = WM_USER_SHELLICON;
  129.   LoadString(hInstance, IDS_APPTOOLTIP,nidApp.szTip,MAX_LOADSTRING);
  130.   Shell_NotifyIcon(NIM_ADD, &nidApp);
  131.  
  132.   return TRUE;
  133. }
  134.  
  135. void Init()
  136. {
  137. // user defined message that will be sent as the notification message to the Window Procedure
  138. }
  139. //
  140. //  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
  141. //
  142. //  PURPOSE:  Processes messages for the main window.
  143. //
  144. //  WM_COMMAND - process the application menu
  145. //  WM_PAINT - Paint the main window
  146. //  WM_DESTROY - post a quit message and return
  147. //
  148. //
  149. LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  150. {
  151. int wmId, wmEvent;
  152.    POINT lpClickPoint;
  153.  
  154. switch (message)
  155. {
  156.  
  157. case WM_USER_SHELLICON:
  158. // systray msg callback
  159. switch(LOWORD(lParam))
  160. {
  161. case WM_RBUTTONDOWN:
  162. UINT uFlag = MF_BYPOSITION|MF_STRING;
  163. GetCursorPos(&lpClickPoint);
  164. hPopMenu = CreatePopupMenu();
  165. InsertMenu(hPopMenu,0xFFFFFFFF,MF_BYPOSITION|MF_STRING,IDM_ABOUT,_T("About"));
  166. if ( bDisable == TRUE )
  167. {
  168. uFlag |= MF_GRAYED;
  169. }
  170. InsertMenu(hPopMenu,0xFFFFFFFF,uFlag,IDM_TEST2,_T("Test 2")); // Test 2
  171. InsertMenu(hPopMenu,0xFFFFFFFF,uFlag,IDM_TEST1,_T("Test 1")); // Test 1
  172. InsertMenu(hPopMenu,0xFFFFFFFF,MF_SEPARATOR,IDM_SEP,_T("SEP"));
  173. if ( bDisable == TRUE )
  174. {
  175. InsertMenu(hPopMenu,0xFFFFFFFF,MF_BYPOSITION|MF_STRING,IDM_ENABLE,_T("Enable"));
  176. }
  177. else
  178. {
  179. InsertMenu(hPopMenu,0xFFFFFFFF,MF_BYPOSITION|MF_STRING,IDM_DISABLE,_T("Disable"));
  180. }
  181. InsertMenu(hPopMenu,0xFFFFFFFF,MF_SEPARATOR,IDM_SEP,_T("SEP"));
  182. InsertMenu(hPopMenu,0xFFFFFFFF,MF_BYPOSITION|MF_STRING,IDM_EXIT,_T("Exit"));
  183.  
  184. SetForegroundWindow(hWnd);
  185. TrackPopupMenu(hPopMenu,TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_BOTTOMALIGN,lpClickPoint.x, lpClickPoint.y,0,hWnd,NULL);
  186. return TRUE;
  187.  
  188. }
  189. break;
  190. case WM_COMMAND:
  191. wmId    = LOWORD(wParam);
  192. wmEvent = HIWORD(wParam);
  193. // Parse the menu selections:
  194. switch (wmId)
  195. {
  196. case IDM_ABOUT:
  197. //DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
  198. break;
  199. case IDM_TEST1:
  200. // MessageBox(NULL,_T("This is a test for menu Test 1"),_T("Test 1"),MB_OK);
  201. break;
  202. case IDM_TEST2:
  203. // MessageBox(NULL,_T("This is a test for menu Test 2"),_T("Test 2"),MB_OK);
  204. break;
  205. case IDM_DISABLE:
  206. bDisable = TRUE;
  207. break;
  208. case IDM_ENABLE:
  209. bDisable = FALSE;
  210. break;
  211. case IDM_EXIT:
  212. Shell_NotifyIcon(NIM_DELETE,&nidApp);
  213. DestroyWindow(hWnd);
  214. break;
  215. default:
  216. return DefWindowProc(hWnd, message, wParam, lParam);
  217. }
  218. break;
  219. /*
  220. case WM_PAINT:
  221. hdc = BeginPaint(hWnd, &ps);
  222. // TODO: Add any drawing code here...
  223. EndPaint(hWnd, &ps);
  224. break;*/
  225. case WM_DESTROY:
  226. PostQuitMessage(0);
  227. break;
  228. default:
  229. return DefWindowProc(hWnd, message, wParam, lParam);
  230. }
  231. return 0;
  232. }
  233.  
  234.  

Archivo Definiciones.h

Código
  1. /** Esta cabecera es para definiciones **/
  2.  
  3.  
  4. #define ID_MENU 3001
  5. #define ID_SYSTRAY_INFO 3002
  6. #define ID_SYSTRAY_DELETE 3003
  7. #define ID_SYSTRAY_EXIT 3004
  8.  
  9. #define ID_ICON 4001
  10.  
  11. #define ID_BMP_CLOSE 5001
  12. #define ID_BMP_ABOUT 5002
  13.  
  14. /** ---------------------------- **/
  15.  
  16. #define IDC_MYICON                      2
  17. #define IDD_SYSTRAYDEMO_DIALOG          102
  18. #define IDS_APP_TITLE                   103
  19. #define IDM_ABOUT                       104
  20. #define IDS_APPTOOLTIP                  104
  21. #define IDM_EXIT                        105
  22. #define IDI_SYSTRAYDEMO                 107
  23. #define IDI_SMALL                       108
  24. #define IDC_SYSTRAYDEMO                 109
  25. #define IDR_MAINFRAME                   128
  26. #define ID_S_                           32771
  27. #define ID_S_EXIT                       32772
  28. #define ID_SYSTRAYMENU_                 32773
  29. #define ID_SYSTRAYMENU_ENABLE           32774
  30. #define ID_SYSTRAYMENU_DISABLE          32775
  31. #define ID_SYSTRAYMENU_TEST1            32776
  32. #define ID_SYSTRAYMENU_TEST2            32777
  33. #define IDM_DISABLE                     32778
  34. #define IDM_ENABLE                      32779
  35. #define IDM_TEST2                       32780
  36. #define IDM_TEST1                       32781
  37. #define ID_SYSTRAYMENU_SEP              32782
  38. #define IDM_SEP                         32783
  39. #define IDC_STATIC                      -1
  40.  
  41. // Next default values for new objects
  42. //
  43. #ifdef APSTUDIO_INVOKED
  44. #ifndef APSTUDIO_READONLY_SYMBOLS
  45. #define _APS_NO_MFC                     1
  46. #define _APS_NEXT_RESOURCE_VALUE        129
  47. #define _APS_NEXT_COMMAND_VALUE         32784
  48. #define _APS_NEXT_CONTROL_VALUE         1000
  49. #define _APS_NEXT_SYMED_VALUE           110
  50. #endif
  51. #endif
  52.  

Archivo stdafx.h

Código
  1. // stdafx.h : include file for standard system include files,
  2. // or project specific include files that are used frequently, but
  3. // are changed infrequently
  4. //
  5.  
  6. #pragma once
  7.  
  8. // Modify the following defines if you have to target a platform prior to the ones specified below.
  9. // Refer to MSDN for the latest info on corresponding values for different platforms.
  10. #ifndef WINVER // Allow use of features specific to Windows XP or later.
  11. #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
  12. #endif
  13.  
  14. #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.                  
  15. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
  16. #endif
  17.  
  18. #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
  19. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
  20. #endif
  21.  
  22. #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
  23. #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
  24. #endif
  25.  
  26. #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
  27. // Windows Header Files:
  28. #include <windows.h>
  29. #include <shellapi.h>
  30. // C RunTime Header Files
  31. #include <stdlib.h>
  32. #include <malloc.h>
  33. #include <memory.h>
  34. #include <tchar.h>
  35.  
  36.  
  37. // TODO: reference additional headers your program requires here
  38.  

Archivo Resource.rc

Código
  1. #include <windows.h>
  2.  
  3. #include "Definiciones.h"
  4.  
  5. ID_MENU MENU
  6. BEGIN
  7. POPUP "&SysTray"
  8. BEGIN
  9. MENUITEM "&About", ID_SYSTRAY_INFO
  10. MENUITEM "&Delete icon", ID_SYSTRAY_DELETE
  11. MENUITEM SEPARATOR
  12. MENUITEM "&Exit", ID_SYSTRAY_EXIT
  13.  
  14. END
  15. END
  16.  
  17. ID_ICON ICON "MouseMove.ico"
  18.  
  19. ID_BMP_CLOSE BITMAP DISCARDABLE "close.bmp"
  20. ID_BMP_ABOUT BITMAP DISCARDABLE "about.bmp"
  21.  
  22. // Creates an Windows XP Style:
  23. 1 24 MOVEABLE PURE "Data1.bin"
  24.  
  25.  
  26. #define APSTUDIO_READONLY_SYMBOLS
  27. /////////////////////////////////////////////////////////////////////////////
  28. //
  29. // Generated from the TEXTINCLUDE 2 resource.
  30. //
  31. #define APSTUDIO_HIDDEN_SYMBOLS
  32. #include "windows.h"
  33. #undef APSTUDIO_HIDDEN_SYMBOLS
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. #undef APSTUDIO_READONLY_SYMBOLS
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // Hebrew resources
  40.  
  41. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HEB)
  42. #ifdef _WIN32
  43. LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT
  44. #pragma code_page(1255)
  45. #endif //_WIN32
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. //
  49. // Icon
  50. //
  51.  
  52. // Icon with lowest ID value placed first to ensure application icon
  53. // remains consistent on all systems.
  54. IDI_SYSTRAYDEMO         ICON                    "MouseMove.ico"
  55. IDI_SMALL               ICON                    "MouseMove.ico"
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. //
  59. // Menu
  60. //
  61.  
  62. IDC_SYSTRAYDEMO MENU
  63. BEGIN
  64.    POPUP "SysTrayMenu"
  65.    BEGIN
  66.        MENUITEM "&About ...",                  IDM_ABOUT
  67.        MENUITEM SEPARATOR
  68.        MENUITEM "Test 1",                      IDM_TEST1
  69.        MENUITEM "Test 2",                      IDM_TEST2
  70.        MENUITEM SEPARATOR
  71.        MENUITEM "Enable",                      IDM_ENABLE
  72.        MENUITEM "Disable",                     IDM_DISABLE
  73.        MENUITEM SEPARATOR
  74.        MENUITEM "E&xit",                       IDM_EXIT
  75.        MENUITEM "SEP",                         IDM_SEP
  76.    END
  77. END
  78.  
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81. //
  82. // Accelerator
  83. //
  84.  
  85. IDC_SYSTRAYDEMO ACCELERATORS
  86. BEGIN
  87.    "?",            IDM_ABOUT,              ASCII,  ALT
  88.    "/",            IDM_ABOUT,              ASCII,  ALT
  89. END
  90.  
  91.  
  92. /////////////////////////////////////////////////////////////////////////////
  93. //
  94. // Dialog
  95. //
  96.  
  97.  
  98.  
  99. #ifdef APSTUDIO_INVOKED
  100. /////////////////////////////////////////////////////////////////////////////
  101. //
  102. // TEXTINCLUDE
  103. //
  104.  
  105. 1 TEXTINCLUDE
  106. BEGIN
  107.    "Definiciones.h\0"
  108. END
  109.  
  110. 2 TEXTINCLUDE
  111. BEGIN
  112.    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
  113.    "#include ""windows.h""\r\n"
  114.    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
  115.    "\0"
  116. END
  117.  
  118. 3 TEXTINCLUDE
  119. BEGIN
  120.    "\r\n"
  121.    "\0"
  122. END
  123.  
  124. #endif    // APSTUDIO_INVOKED
  125.  
  126.  
  127. /////////////////////////////////////////////////////////////////////////////
  128. //
  129. // String Table
  130. //
  131.  
  132. STRINGTABLE
  133. BEGIN
  134.    IDS_APP_TITLE           "SysTrayDemo"
  135.    IDS_APPTOOLTIP          "SysTray Demo"
  136.    IDC_SYSTRAYDEMO         "SYSTRAYDEMO"
  137. END
  138.  
  139. #endif    // Hebrew resources
  140. /////////////////////////////////////////////////////////////////////////////
  141.  
  142.  
  143.  
  144. #ifndef APSTUDIO_INVOKED
  145. /////////////////////////////////////////////////////////////////////////////
  146. //
  147. // Generated from the TEXTINCLUDE 3 resource.
  148. //
  149.  
  150.  
  151. /////////////////////////////////////////////////////////////////////////////
  152. #endif    // not APSTUDIO_INVOKED
  153.  
  154.  

Ahora os explico, lo único que quiero es que al iniciar el programa (GUI Application), se cree un icono en el System Tray, y se quede ahí mientras el programa va corriendo, y que puedas usar las funciones del Menu al hacer click derecho en el Icono, todo esto sin que el programa tenga interfaz gráfica, es decir, que el programa solo exista en el Tray, y que si quieres usar alguna función, la llames desde el menú del icono... Pero la liada de código es tan grande que no se por donde meter mano... a ver si alguien puede arreglar el código, comentar lo que hace cada cosa y quitar archivos y todos los procedimientos que no sean necesarios, ya que hay funciones que hacen lo mismo, se crean dos iconos en el Tray, etc... así el código lo pueden usar ustedes también si quieren...

Gracias y Saludos


« Última modificación: 2 Agosto 2013, 14:06 pm por MeCraniDOS » En línea

"La física es el sistema operativo del Universo"
     -- Steven R Garman
aguml


Desconectado Desconectado

Mensajes: 378



Ver Perfil
Re: [?] Alguien que pueda optimizar y arreglar este codigo
« Respuesta #1 en: 3 Agosto 2013, 02:49 am »

sinceramente creo que deberias depurarlo tu mismo e ir viendo lo que hace y así buscar el fallo.


En línea

MeCraniDOS


Desconectado Desconectado

Mensajes: 337


Sr. Glass


Ver Perfil
Re: [?] Alguien que pueda optimizar y arreglar este codigo
« Respuesta #2 en: 3 Agosto 2013, 04:37 am »

sinceramente creo que deberias depurarlo tu mismo e ir viendo lo que hace y así buscar el fallo.

Como lo depuro? (El mejor depurador?)  :rolleyes:  :rolleyes:
En línea

"La física es el sistema operativo del Universo"
     -- Steven R Garman
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Se puede optimizar este codigo ?
PHP
nobo 6 3,581 Último mensaje 5 Marzo 2012, 22:41 pm
por nobo
Se puede optimizar más este codigo?
Desarrollo Web
z3nth10n 2 2,644 Último mensaje 16 Abril 2013, 07:33 am
por z3nth10n
Alguien que me pueda ayudar con este fragmento de código
Programación C/C++
David8 5 2,888 Último mensaje 4 Abril 2014, 12:01 pm
por Eternal Idol
A ver si alguien puede arreglar este código.
.NET (C#, VB.NET, ASP)
iDDoS 2 1,909 Último mensaje 12 Mayo 2015, 02:29 am
por Eleкtro
Optimizar el código de este ejercicio (arrays) C++
Programación C/C++
seryioo 1 2,054 Último mensaje 8 Agosto 2015, 08:37 am
por exoesqueleto
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines