EOSERV Forum > Programming > resource file
Topic is locked.
Page: << 1 >>
resource file
Author Message
Post #195605 resource file

isn't winres.rc trying to add a file menu to eoserv? why doesn't it do so? has sausage not implemented this then?

---
I not hacker

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its
whole life believing that it is stupid.” - Albert Einstein : Really Great Quote Ramy!
10 years, 34 weeks ago
Post #195624 Re: resource file

winres.rc adds the icon to eoserv.exe.

10 years, 32 weeks ago
Post #195634 Re: resource file

Uhm  sir. Please stay on topic here.

---
I not hacker

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its
whole life believing that it is stupid.” - Albert Einstein : Really Great Quote Ramy!
10 years, 31 weeks ago
Post #195637 Re: resource file

The answer was perfectly on topic. The .rc file is used as an ornamental tool to do things prior to the execution of an .exe file such as add the icon or provide information about the program in a Windows environment. Google resource files (.rc) for more info.

10 years, 31 weeks ago
Post #195640 Re: resource file

quote: Alex

isn't winres.rc trying to add a file menu to eoserv? why doesn't it do so? has sausage not implemented this then?

endQ


none of your low quality comments have answered any of my questions yet. @insomniac thanks for your continued support


---
I not hacker

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its
whole life believing that it is stupid.” - Albert Einstein : Really Great Quote Ramy!
10 years, 31 weeks ago
Post #195642 Re: resource file
Hacker_Alex posted: (9th Jun 2014, 02:24 pm)

quote: Alex

isn't winres.rc trying to add a file menu to eoserv? why doesn't it do so? has sausage not implemented this then?

endQ


none of your low quality comments have answered any of my questions yet. @insomniac thanks for your continued support



No, as far as I know That type of usage of an rc file is meant for win32/gui projects eoserv is just a console app, so even if you add the files needed to produce a file menu it wont do anything!

The rc file:
#define IDR_MAIN_MENU             2000
#define IDM_FILE_OPEN             2100
#define IDM_FILE_EXIT             2105

IDR_MAIN_MENU MENU DISCARDABLE
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Open...",      IDM_FILE_OPEN
        MENUITEM "E&xit",         IDM_FILE_EXIT
    END
END

Add to main.cpp:

#include <windows.h> #define IDR_MAIN_MENU 2000 #define IDM_FILE_OPEN 2100 #define IDM_FILE_EXIT 2105 long __stdcall WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { if(message==WM_DESTROY) PostQuitMessage(0); else return DefWindowProc(hwnd, message, wParam, lParam); return 0; } int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpszArgument, int nCmdShow) { char szClassName[ ] = "CodeBlocksWindowsApp"; MSG messages; WNDCLASS wc; HWND hwnd; wc.hInstance = hInstance, wc.lpszClassName = szClassName; wc.lpfnWndProc = WindowProcedure, wc.style = 0; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION), wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAIN_MENU), wc.cbClsExtra = 0; wc.cbWndExtra = 0, wc.hbrBackground = (HBRUSH)COLOR_BACKGROUND; RegisterClass(&wc); hwnd=CreateWindow(szClassName,"Template",WS_OVERLAPPEDWINDOW,50,50,544,375,HWND_DESKTOP,NULL,hInstance,NULL); ShowWindow (hwnd, nCmdShow); while(GetMessage (&messages, NULL, 0, 0)) { TranslateMessage(&messages); DispatchMessage(&messages); } return messages.wParam; }


Maybe try creating a win32 gui frame based app and add this in! My antivirus picks up the
win32 gui projects but as far as I know its a false positive!

Edit: Now that you have me messing around with rc files I've found myself editing the file descriptions on all my projects >.<!



10 years, 31 weeks ago
Post #195672 Re: resource file
insomniac posted: (9th Jun 2014, 04:43 pm)

Hacker_Alex posted: (9th Jun 2014, 02:24 pm)

quote: Alex

isn't winres.rc trying to add a file menu to eoserv? why doesn't it do so? has sausage not implemented this then?

endQ


none of your low quality comments have answered any of my questions yet. @insomniac thanks for your continued support



No, as far as I know That type of usage of an rc file is meant for win32/gui projects eoserv is just a console app, so even if you add the files needed to produce a file menu it wont do anything!

The rc file:
#define IDR_MAIN_MENU             2000
#define IDM_FILE_OPEN             2100
#define IDM_FILE_EXIT             2105

IDR_MAIN_MENU MENU DISCARDABLE
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Open...",      IDM_FILE_OPEN
        MENUITEM "E&xit",         IDM_FILE_EXIT
    END
END

Add to main.cpp:

#include <windows.h> #define IDR_MAIN_MENU 2000 #define IDM_FILE_OPEN 2100 #define IDM_FILE_EXIT 2105 long __stdcall WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { if(message==WM_DESTROY) PostQuitMessage(0); else return DefWindowProc(hwnd, message, wParam, lParam); return 0; } int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpszArgument, int nCmdShow) { char szClassName[ ] = "CodeBlocksWindowsApp"; MSG messages; WNDCLASS wc; HWND hwnd; wc.hInstance = hInstance, wc.lpszClassName = szClassName; wc.lpfnWndProc = WindowProcedure, wc.style = 0; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION), wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAIN_MENU), wc.cbClsExtra = 0; wc.cbWndExtra = 0, wc.hbrBackground = (HBRUSH)COLOR_BACKGROUND; RegisterClass(&wc); hwnd=CreateWindow(szClassName,"Template",WS_OVERLAPPEDWINDOW,50,50,544,375,HWND_DESKTOP,NULL,hInstance,NULL); ShowWindow (hwnd, nCmdShow); while(GetMessage (&messages, NULL, 0, 0)) { TranslateMessage(&messages); DispatchMessage(&messages); } return messages.wParam; }


Maybe try creating a win32 gui frame based app and add this in! My antivirus picks up the
win32 gui projects but as far as I know its a false positive!

Edit: Now that you have me messing around with rc files I've found myself editing the file descriptions on all my projects >.<!




Hehe! Thanks for this great detailed response (: Glad to have you started on something fun P:
---
I not hacker

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its
whole life believing that it is stupid.” - Albert Einstein : Really Great Quote Ramy!
10 years, 28 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Programming > resource file