Create Button and create label

This commit is contained in:
mmacierzanka committed 2021-04-18 20:43:03 +02:00
1 parent 715e2eb9c9
commit 5757b435b2
5 files changed
+8 -8

No files matched your search

-1
View File
@@ -139,7 +139,6 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Easy Audio Player.h" />
<ClInclude Include="EzWinAPIBuilders.h" /> <ClInclude Include="EzWinAPIBuilders.h" />
<ClInclude Include="framework.h" /> <ClInclude Include="framework.h" />
<ClInclude Include="Resource.h" /> <ClInclude Include="Resource.h" />
-3
View File
@@ -24,9 +24,6 @@
<ClInclude Include="Resource.h"> <ClInclude Include="Resource.h">
<Filter>Pliki nagłówkowe</Filter> <Filter>Pliki nagłówkowe</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Easy Audio Player.h">
<Filter>Pliki nagłówkowe</Filter>
</ClInclude>
<ClInclude Include="EzWinAPIBuilders.h"> <ClInclude Include="EzWinAPIBuilders.h">
<Filter>Pliki nagłówkowe</Filter> <Filter>Pliki nagłówkowe</Filter>
</ClInclude> </ClInclude>
+6
View File
@@ -20,3 +20,9 @@ WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance,
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent) { HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent) {
return CreateWindowEx(WS_EX_CLIENTEDGE, windowClass.lpszClassName, windowTitle, windowStyles, CW_USEDEFAULT, CW_USEDEFAULT, windowWidth, windowHeight, parent, NULL, instance, NULL); return CreateWindowEx(WS_EX_CLIENTEDGE, windowClass.lpszClassName, windowTitle, windowStyles, CW_USEDEFAULT, CW_USEDEFAULT, windowWidth, windowHeight, parent, NULL, instance, NULL);
} }
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow) {
return CreateWindowEx(0, L"BUTTON", label, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
}
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow) {
return CreateWindowEx(0, L"STATIC", startingContent, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
}
+2 -2
View File
@@ -2,8 +2,8 @@
#include <Windows.h> #include <Windows.h>
#ifndef FUNCTIONS_H_INCLUDED #ifndef FUNCTIONS_H_INCLUDED
#define FUNCTIONS_H_INCLUDED #define FUNCTIONS_H_INCLUDED
WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance, LPCWSTR classIcon, LPCWSTR cursor, HBRUSH backgroundBrush); WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance, LPCWSTR classIcon, LPCWSTR cursor, HBRUSH backgroundBrush);
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent); HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent);
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow);
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow);
#endif #endif
-2
View File
@@ -2,9 +2,7 @@
MSG msg; MSG msg;
WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance, LPCWSTR classIcon, LPCWSTR cursor, HBRUSH backgroundBrush);
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent);
int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLine, int nCmdShow) { int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLine, int nCmdShow) {
WNDCLASSEX windowClass = EzCreateClass(L"Easy Audio Player", WndProc, currentInst, IDI_ERROR, IDC_ARROW, NULL); WNDCLASSEX windowClass = EzCreateClass(L"Easy Audio Player", WndProc, currentInst, IDI_ERROR, IDC_ARROW, NULL);