是其它程序的标题栏,只隐藏任务栏上的标题,但不隐藏程序窗口即不使用ShowWindow,如何实现?谢谢
解决方案 »
- 跪求高手啊,我每次按了ctrl+f2也就是program reset的时候,都会弹出下面的对话框,然后就必须要重新打开delphi,怎么解决
- 暂停程序
- 江湖救急,什么是模2和 ,在线等,完成就结帐.
- 关于导出数据到EXCEL的问题
- 关于VCL50.BPL
- 谁有使用delphi和微软的ado对象的的数据库操作的代码?特别是:添加,删除?
- 如何提高数据库打开的速度,有lookup字段
- 如何对正在修改的数据进行锁定
- 下午的面试题目,一定要帮我解决啦。
- 小弟不才,如何判断某个指定位置的文件夹是否存在?文件可以用FILEEXISTS,文件夹用什么呢?创建文件夹用哪个函数呢?急急急!!!
- Delphi中,如何锁定鼠标。在线等~~~~~~~~~~
- 大虾请进---------MemoryStream为什么操作大文件超过100多M时会停很久?
Forms, Windows,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
Application.Initialize;
SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
OperateButtonInTaskbar('Windows 任务管理器', otHide)uses CommCtrl;type
TOperationType = (otHide = 1, otShow = 0, otDelete = 2);function OperateButtonInTaskbar(const ACaption: string; AOperation:
TOperationType = otHide): Boolean;
type
PTBButtonEx = ^TTBButtonEx;
TTBButtonEx = packed record
Button: TTBButton;
Caption: array[0..MAXBYTE-1] of Char;
end;
var
TaskbarHandle: HWND;
PID, ProcessHandle, NumberOfBytesRead: Cardinal;
AllocatedMem: PTBButtonEx;
ButtonInfo: TTBButtonEx;
I, CaptionLength: Integer;
begin
Result := False; TaskbarHandle := FindWindow('Shell_TrayWnd', nil);
TaskbarHandle := FindWindowEx(TaskbarHandle, 0, 'ReBarWindow32', nil);
TaskbarHandle := FindWindowEx(TaskbarHandle, 0, 'MSTaskSwWClass', nil);
TaskbarHandle := FindWindowEx(TaskbarHandle, 0, 'ToolbarWindow32', nil);
if TaskbarHandle = 0 then Exit; GetWindowThreadProcessId(TaskbarHandle, PID);
ProcessHandle := OpenProcess(PROCESS_VM_OPERATION or PROCESS_VM_READ, False,
PID);
if ProcessHandle = 0 then Exit;
AllocatedMem := VirtualAllocEx(ProcessHandle, nil, SizeOf(TTBButtonEx),
MEM_COMMIT, PAGE_READWRITE);
if AllocatedMem = nil then Exit; for I := 0 to SendMessage(TaskbarHandle, TB_BUTTONCOUNT, 0, 0)-1 do
begin
if SendMessage(TaskbarHandle, TB_GETBUTTON, I, Integer(AllocatedMem)) = 0
then Exit;
if not ReadProcessMemory(ProcessHandle, AllocatedMem, @ButtonInfo,
SizeOf(TTBButton), NumberOfBytesRead) then Exit;
CaptionLength := SendMessage(TaskbarHandle, TB_GETBUTTONTEXT,
ButtonInfo.Button.idCommand, Integer(@AllocatedMem^.Caption));
if CaptionLength = -1 then Exit;
if not ReadProcessMemory(ProcessHandle, @AllocatedMem^.Caption,
@ButtonInfo.Caption, SizeOf(ButtonInfo.Caption), NumberOfBytesRead) then Exit;
if ButtonInfo.Caption = ACaption then
begin
if AOperation = otDelete then
Result := BOOL(SendMessage(TaskbarHandle, TB_DELETEBUTTON, I, 0))
else
Result := BOOL(SendMessage(TaskbarHandle, TB_HIDEBUTTON,
ButtonInfo.Button.idCommand, Ord(AOperation)));
SendMessage(TaskbarHandle, TB_AUTOSIZE, 0, 0);
Break
end
end; VirtualFreeEx(ProcessHandle, AllocatedMem, 0, MEM_RELEASE);
CloseHandle(ProcessHandle);
end;
var
hOthers: THandle;
begin
hOthers := FindWindow('360se5_Frame', nil);
if hOthers = 0 then
ShowMessage('not found!')
else
SetWindowText(hOthers, '');
end;