程式語言 - Wine - C/C++ - Resource - StringTable



參考資訊:
http://www.winprog.org/tutorial/
http://winapi.freetechsecrets.com/win32/
https://github.com/gammasoft71/Examples_Win32
http://masm32.com/board/index.php?topic=3584.0
https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles

main.c

#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <commctrl.h>
 
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    char buf[255] = {0};

    LoadString(hInstance, 1001, buf, sizeof(buf));
    MessageBox(NULL, buf, "main", MB_OK);
    ExitProcess(0);
    return 0;
}

main.rc

STRINGTABLE
{
    1001    "Test-1001"
}

編譯、執行

$ x86_64-w64-mingw32-windres main.rc -o main.res
$ winegcc main.c main.res -o main
$ wine ./main.exe