Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // waid\application.d
- // written by beta69
- module waid.application;
- import waid.window;
- import waid.winapi;
- import std.c.windows.windows;
- private shared Window[int] Windows;
- private shared HINSTANCE S_Instance;
- private shared HINSTANCE S_pInstance;
- private shared LPSTR S_lpCmdLine;
- private shared int S_iCmdShow;
- /**
- Sets the standard windows application information.
- */
- void SetStandardWin(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR cmdL, int cmdS)
- {
- S_Instance = cast(shared(HINSTANCE))hInstance;
- S_pInstance = cast(shared(HINSTANCE))prevInstance;
- S_lpCmdLine = cast(shared(LPSTR))cmdL;
- S_iCmdShow = cast(shared(int))cmdS;
- }
- /**
- Gets the standard windows application instance.
- */
- HINSTANCE GetStandardInstance()
- {
- return cast(HINSTANCE)S_Instance;
- }
- /**
- Gets the standard windows application previous instance.
- */
- HINSTANCE GetStandardPrevInstance()
- {
- return cast(HINSTANCE)S_pInstance;
- }
- /**
- Gets the standard windows application cmd line.
- */
- LPSTR GetStandardCmdLine()
- {
- return cast(LPSTR)S_lpCmdLine;
- }
- /**
- Gets the standard windows application cmd show.
- */
- int GetStandardCmdShow()
- {
- return cast(int)S_iCmdShow;
- }
- /**
- Adds a window to the application.
- */
- void AddWindow(Window W)
- {
- synchronized
- {
- Window[int] windows = cast(Window[int])Windows;
- windows[W.IDC] = W;
- }
- }
- /**
- Removes a window from the application.
- */
- void RemoveWindow(Window W)
- {
- W.Dispose();
- Windows.remove(W.IDC);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement