1 module awebview.wrapper.sys;
2 
3 import derelict.sdl2.sdl;
4 
5 
6 version(Windows)
7 {
8     import core.sys.windows.com;
9     import core.sys.windows.windows;
10 
11     extern(Windows) nothrow export @nogc
12     {
13         LONG SetWindowLongW(HWND,int,LONG);
14         BOOL MoveWindow(
15               HWND hWnd,      // ウィンドウのハンドル
16               int X,          // 横方向の位置
17               int Y,          // 縦方向の位置
18               int nWidth,     // 幅
19               int nHeight,    // 高さ
20               BOOL bRepaint   // 再描画オプション
21             );
22     }
23 
24     extern (C)
25     {
26         extern CLSID CLSID_TaskbarList;
27     }
28 
29     extern(C)
30     {
31         extern IID IID_ITaskbarList;
32     }
33 
34     extern(System)
35     interface ITaskbarList : IUnknown
36     {
37         HRESULT HrInit();
38         void unusedAddTab();
39         HRESULT DeleteTab(HWND hwnd);
40         HRESULT unusedActivateTab();
41         HRESULT unusedSetActivateAlt();
42     }
43 
44     void deleteFromTaskbar(HWND hwnd)
45     {
46         ITaskbarList tbl;
47         CoCreateInstance(&CLSID_TaskbarList,
48             null,
49             CLSCTX_INPROC_SERVER,
50             &IID_ITaskbarList,
51             cast(void*)&tbl);
52         tbl.HrInit();
53         tbl.DeleteTab(hwnd);
54     }
55 }
56 
57 
58 void deleteFromTaskbar(SDL_Window* sdlWindow)
59 {
60     version(Windows)
61     {
62         SDL_SysWMinfo wmi;
63         SDL_VERSION(&(wmi.version_));
64 
65         if(SDL_GetWindowWMInfo(sdlWindow, &wmi))
66             deleteFromTaskbar(wmi.info.win.window);
67     }
68     //else
69     //    static assert(0, "'deleteFromTaskbar' has not been implemented yet.");
70 }