CE Hide and Display System Task Bar

zhaozj2021-02-16  89

HWND HWNDINPUTPANEL = NULL;

HWND HWNDTASKBAR = NULL;

HWND HWNDSIPBUTTON = NULL;

Rect RTDesktop;

Rect RTNewDesktop;

// Rect RTINPUTPANEL;

// Rect RTSIPBUTTON;

Rect rttaskbar;

// Initialize the taskbar, get the taskbar window parameters

INT initfulscreen (void)

{

Int results = 0;

__TRY

{

IF (SYSTEMPARETERSINFO (SPI_GetWorkarea, 0, & RTDesktop, NULL) == 1)

{

// Successful Obtain The System Working Area (Desktop)

SetRect (& RTNEWDESKTOP, 0, 0, CEP_SCREEN_WIDTH, CEP_SCREEN_HEIGHT);

// Change System Setting

SystemParametersInfo (SPI_Setworkarea, 0, & RTNewDesktop, Spif_UpdateIfile);

}

HWndtaskbar = FindWindow (Text ("Hhtaskbar"), NULL);

// checking ...

IF (hwndtaskbar! = null)

{

// Get the Original Taskbar Window Size

GetWindowRect (HWndtaskbar, & RTTaskbar);

IF (RTTASKBAR.TOP> = Cep_Screen_Height)

{

RTTASKBAR.TOP = CEP_SCREEN_HEIGHT - (RTTASKBAR.BOTTOM-RTTASKBAR.TOP);

RTTASKBAR.BOTTOM = CEP_SCREEN_HEIGHT;

}

}

}

__EXCEPT (Exception_execute_Handler)

{

// put your error log code

// set return value

Result = 1;

}

Return Result;

}

/ / Move the taskbar window to the screen when you hide, and then move it again.

Int Dofullscreen (Bool Mode)

{

Int results = 0;

__TRY

{

IF (Mode)

{

// Update Window Working Area Size

SystemParametersInfo (SPI_Setworkarea, 0, & RTNewDesktop, Spif_UpdateIfile);

IF (NULL! = hwndtaskbar)

{

// hide the taskbar

MoveWindow (hwndtaskbar,

0,

RTNewdesktop.bottom,

Rttaskbar.right - RTTASKBAR.LEFT,

RTTASKBAR.BOTTOM - RTTSKBAR.TOP,

FALSE);

}

}

Else

{

// Update Window Working Area Size

SystemParametersInfo (SPI_Setworkarea, 0, & RTDesktop, Spif_UpdateInifile);

// restore the taskbar

IF (NULL! = hwndtaskbar)

{

MoveWindow (hwndtaskbar, rttaskbar.left,

RTTASKBAR.TOP,

Rttaskbar.right - RTTASKBAR.LEFT,

RTTASKBAR.BOTTOM - RTTSKBAR.TOP,

FALSE);

}

}

}

__EXCEPT (Exception_execute_Handler)

{

// put your error log code

// set return value

Result = 1;

}

Return Result;

}

转载请注明原文地址:https://www.9cbs.com/read-12907.html

New Post(0)