Last active
May 30, 2016 01:44
-
-
Save kuttsun/be082fae9700f47e37e681b9f795649a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// タスクバーとスタートボタンの表示と非表示を切り替えるプログラム | |
#include "stdafx.h" | |
#include <windows.h> | |
#include <tchar.h> | |
int main() | |
{ | |
// ClassName and WindowName | |
LPCTSTR name[][2] = { | |
{ _T("Shell_TrayWnd"), NULL },// Taskbar | |
{ _T("Button"), NULL },// Start Button | |
//{ _T("DV2ControlHost"), NULL}// Start Menu | |
}; | |
BOOL currentState = FALSE; | |
for (int i = 0; i < sizeof(name) / sizeof(name[0]); i++) { | |
HWND hWnd = FindWindow(name[i][0], name[i][1]); | |
if (i == 0) { | |
currentState = IsWindowVisible(hWnd);// Taskbar State | |
} | |
ShowWindow(hWnd, (currentState == FALSE ? SW_SHOW : SW_HIDE) ); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment