Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
"GUI 2.exe": "C:\Users\Kevin\Documents\Visual Studio 2010\Projects\GUI 2\Debug\GUI 2.exe" geladen, Symbole wurden geladen. "GUI 2.exe": "C:\Windows\SysWOW64\ntdll.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\kernel32.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\KernelBase.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\user32.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\gdi32.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\lpk.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\usp10.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\msvcrt.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\advapi32.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\sechost.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\rpcrt4.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\sspicli.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\cryptbase.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\msvcr100d.dll" geladen, Symbole wurden geladen. "GUI 2.exe": "C:\Windows\SysWOW64\imm32.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\msctf.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\uxtheme.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\dwmapi.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\ole32.dll" geladen, Cannot find or open the PDB file "GUI 2.exe": "C:\Windows\SysWOW64\oleaut32.dll" geladen, Cannot find or open the PDB file Das Programm "[3592] GUI 2.exe: Systemeigen" wurde mit Code 0 (0x0) beendet. |
|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
#include <windows.h> #include <stdio.h> #include <cstdio> HWND hwndButton; HWND hwndEdit; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hI, HINSTANCE hPrI, PSTR szCmdLine, int iCmdShow) { LPWSTR szName = L"Fensterklasse"; WNDCLASS wc; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hI; wc.hIcon = LoadIcon (NULL,IDI_WINLOGO); wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH) GetStockObject(GRAY_BRUSH); //wc.hbrBackground = CreateSolidBrush(RGB(0,0,0)); wc.lpszMenuName = NULL; wc.lpszClassName = szName; RegisterClass(&wc); HWND hwnd = CreateWindow(szName, L"<Graphical User Interface>", WS_SYSMENU | WS_SIZEBOX, 0,0,300,200,NULL,NULL,hI,NULL); ShowWindow(hwnd, iCmdShow); UpdateWindow(hwnd); MSG msg; while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; switch(message) { case WM_PAINT: hdc = BeginPaint(hwnd, &ps); TextOut(hdc, 20, 20, L"Wert", 4); EndPaint(hwnd, &ps); return 0; case WM_CREATE: hwndButton = CreateWindow(L"button", L"Einlesen!", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, 160, 20, 100, 18, hwnd, (HMENU)1, GetModuleHandle(0),0); hwndEdit = CreateWindow(L"edit",L"##############", WS_VISIBLE | WS_CHILD, 60,20,80,17,hwnd,0, GetModuleHandle(0),0); return 0; case WM_COMMAND: switch(wParam) { case 1: { wchar_t text[256]; SendMessage(hwndEdit, WM_GETTEXT, 256, (LPARAM)text); MessageBox(hwnd, text, L"Edit -- Feld", MB_OK); return 0; } } case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, message, wParam, lParam); } |
![]()
C/C++ Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 case WM_COMMAND: switch(wParam) { case 1: { wchar_t text[256]; SendMessage(hwndEdit, WM_GETTEXT, 256, (LPARAM)text); MessageBox(hwnd, text, L"Edit -- Feld", MB_OK); return 0; } } case WM_DESTROY: PostQuitMessage(0); return 0;
Könntest du mir auch noch sagen wie ich normale Button/Edit felder erstelle die nicht so mies aussehen?
Also Button wäre dann etwas mehr 3D
Ich meine so wie die normalen Windows Buttons
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
#ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") #elif defined _M_X64 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") #else #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #endif #endif |