Jump to content
The simFlight Network Forums

Mirkos

Members
  • Posts

    12
  • Joined

  • Last visited

About Mirkos

  • Birthday 01/01/1970

Contact Methods

  • MSN
    mirko.siciliano@gmail.com
  • Website URL
    http://mirkosic.altervista.org

Profile Information

  • Location
    Olbia, Italia

Mirkos's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Scott, i use the instance for CreateDialog in this way: HINSTANCE instance; //declaration ... ... BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { instance = hInstDLL; //copies the hInstDLL into "instance" for use it into all the APIs ... ... } now you can use it (instance) into CreateDialog(instance,...) ! Best Regards, Mirko Siciliano
  2. thank you for your answer!!!! :D :D :D :D :D :D :D :D :D :D
  3. thank you for your complete explanation Tim!!! best regards Mirko
  4. No, i'm not new to C but i've never saw a void pointer, only void methods!!!!. Thank you for the answer!!! Mirko
  5. i would use this code in C but i dont now how use the FSUIPC_Write(DWORD dwOffset, DWORD dwSize, void *pSrce, DWORD *pdwResult); how can i use the "void *pSrce"? Please someone gives me an example..... regards Mirko :D
  6. hi, search this file on avsim "fsmenu.zip". it will help you!
  7. THANK YOU VERY MUCH PETE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Regards, Mirko
  8. Hi, does anyone know how to write "text with green background messages" on the flight simulator screen from a C-programmed module? i need help.....please answer!! thanks mirkos
  9. why when i call a dialogbox api flight simulator goes in pause? thanks for the answer mirko
  10. IT WORKS!!!!!!!!! THANKS. Now i've another question: why when i call a dialogbox api flight simulator goes in pause? thanks for the answer mirko
  11. Hi, i'm trying to program a fs2004 module, this is the main file: #include #include "module.h" #include "resource.h" BOOL APIENTRY InfoDlgProc(HWND, UINT, WPARAM, LPARAM); HINSTANCE hinst; HWND g_hToolbar = NULL; /* * We define just basic interface to the flight simulator so it will be * able to load the module. */ DLLEXPORT MODULE_IMPORT ImportTable = { {0x00000000, NULL}, {0x00000000, NULL} }; void FSAPI module_init(void) {} void FSAPI module_deinit(void) {} DLLEXPORT MODULE_LINKAGE Linkage = { 0x00000000, module_init, module_deinit, 0, 0, 0x0900, // FS2004 version (use 0x0800 for FS2002) NULL }; // The standard window procedure used by the flight simulator WNDPROC oldWndProc; // Flight simulator main window handle HWND hFSimWindow; #define MENU_ENTRY "&FSSerial" #define ID_MY_MENUITEM 40002 /** * Main window procedure that is called by the flight simulator to process * incoming window messages. */ LRESULT CALLBACK FSimWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_NCPAINT: { HMENU hMenu, hMyMenu; hMenu = GetMenu(hwnd); if (hMenu != NULL) { int i; // Look for our menu entry in the main menu. for (i = 0; i < GetMenuItemCount(hMenu); i++) { char buf[128]; GetMenuString(hMenu, i, buf, 128, MF_BYPOSITION); if (strcmp(buf, MENU_ENTRY) == 0) { // It is already here, we do not need to add it again break; } } if (i < GetMenuItemCount(hMenu)) { // It is already here, we do not need to add it again break; } /* Create new menu. NOTE: It seems that this will be * reached more times, so we cannot save the handle, because * in such case it could be destroyed and we will not have * any access to it in the simulator. */ hMyMenu = CreateMenu(); AppendMenu(hMyMenu, MF_STRING | MF_ENABLED, ID_MY_MENUITEM, "Info"); // add the created menu to the main menu AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT_PTR)hMyMenu, MENU_ENTRY); DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_INFO) , hFSimWindow, (DLGPROC)InfoDlgProc); } } break; case WM_COMMAND: if (LOWORD(wParam) == ID_MY_MENUITEM) { // This is my code DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_INFO) , hwnd, (DLGPROC)InfoDlgProc); MessageBox(hwnd, "Ancora in costruzione!", "FSSerial - by Mirko Siciliano", MB_OK | MB_ICONEXCLAMATION); return 0; } break; } // Call the original window procedure to handle all other messages return CallWindowProc(oldWndProc, hwnd, uMsg, wParam, lParam); } BOOL APIENTRY InfoDlgProc(HWND hDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) { switch(uMsg) { case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: EndDialog(hDlg,0); return TRUE; } break; default: return FALSE; } return TRUE; } /** * Entry point of the DLL. */ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: hFSimWindow = FindWindow("FS98MAIN", NULL); oldWndProc = (WNDPROC)SetWindowLong(hFSimWindow, GWL_WNDPROC, (LONG)FSimWindowProc); break; } return TRUE; } I need to show a dialog included into the resources but compiling this code it only dispalys my menu into Flight Simulator and when i click on the "Info" sub menu it shows only the messagebox. COULD ANYONE HELP ME???? PLEASE.............................. Thanks P.S. I'm sorry for my english! i'm italian
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.