Arsip: menempatkan icon dalam sistem tray

more 19 years ago
marvel
ini buat yg belum tao and yg uda tao :wink:
uses
..., ShellAPI;
const
WM_ICONTRAY = WM_USER + 1; //User-defined message
type
...
var
...
NotifyIconData : TNotifyIconData;
implementation
procedure Tform1.formcreate(sender:Tobject);
begin
with NotifyIconData do
begin
hIcon := Icon.Handle;
StrPCopy(szTip, Application.Title);
Wnd := Handle;
uCallbackMassage := WM_ICONTRAY;
uID := 1;
uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
cbSize := sizeof(TNotifyIconData);
end;
shell_NotifyIconData(NIM_ADD,@NotifyIconData);
{ini bisa ditaruh di onMinimize ato yg lainnya yg diatas juga heheh...}
SetWindowLong(
Application.Handle,
GWL_EXSTYLE,
WS_EX_TOOLWINDOW);
end;
[/code:1:10b8e9f714]
-code diatas digunakan untuk memunculkan icon pada objectinspector Form1
-tambahkan popupmenu untuk listing code dibawah ini
-jangan lupa icon nya dikasih gambar yah... kalo nga nti binggung...
type
TForm1 = class(TForm)
....
private
{ Private declarations }
....
procedure Icontray(
var Msg: Tmessage); message WM_ICONTRAY;
public
{ Public declarations }
...
end;
procedure Tform1.Icontray(var Msg : Tmessage);
var
CursorPos : Tpoint;
begin
if Msg.LParam = WM_RBUTTONDOWN then
begin
GetCursorPos(CursorPos);
PopupMenu1.Popup(CursorPos.X, CursorPos.Y);
end else
inherited;
end;
-menampilkan dan menyembunyikan form
-tambahkan Exit dan Show pada item di popupmenu
[code:1:10b8e9f714]
procedure TForm1.Show1Click(Sender: TObject);
begin
Application.Restore;
// Shell_NotifyIcon(NIM_DELETE,@NotifyIconData);
end;
procedure Tform1.FormClose(
Sender : TObject;
var Action : TCloseAction);
begin
Action := caNone;
Hide;
//Shell_NotifyIcon(NIM_ADD,@NotifyIcaonData);
end;
Procedure TForm1.Exit1Click(sender: TObject);
begin
Shell_NotifyIcon(NIM_DELETE,@NotifyIconData);
Application.ProcessManager;
Application.Terminate;
end;
pertanyaannya...
-pada even show1click aku menggunakana Application.Restore karena
pada saat aku menggunakan Form1.Show; tidak terjadi apa2...
-kira2 kenapa yah?
- ada code yg lain buat nampilin form nya nga ?
- Thanks
- Selamat Mencoba
more 19 years ago
cyber_hecker
OOT: good.. good.. nice job... kept working.. @[gak tau artinya, yang penting keliatan keren] kekekeke....

more 19 years ago
LuriDarmawan
buat marvel,
sebaiknya dimasukkan ke artikel saja.
kirim artikel bisa ke:
http://pascal-id.org/dpr/Submit_News.pas

more 19 years ago
Share to
marvel
cyber hacker @
more 19 years agoEkoIndri
@marvel sip2, namun lebih baik masuk di artikel. usul kalau ada editor yang bertugas memuskkan artikel.more ...
- Pages:
- 1
reply | Report Obsolete
AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 5 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 13 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 13 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 13 years ago
Random Topic
- Ada Yang Jual Code Gear Second Hand Tapi Original ??
by belajaraja in Lain-lain more 14 years ago - Turbo Delphi Price
by Kecret in OOT more 19 years ago - cetak faktur ukuran 1/2 folio
by tupay in Reporting more 17 years ago - Saran: Last Forum Post ?
by cyber_hecker in Kritik & Saran more 20 years ago - [Tanya]Lookup combobox di dbgrid
by abay_pop in Tip n Trik Pemrograman more 16 years ago - Minta Bantuannya.......'temen2,,,
by musespratama in Lain-lain more 14 years ago - startup ???
by asiyrob in Enginering more 18 years ago - ambil karakter
by javaman in Hal umum tentang Pascal Indonesia more 19 years ago - tanya buat subtotal dan total di quict report
by budhie_yk in Reporting more 17 years ago - gimana supaya 0 -> - di fastreport ?
by slamet_linux in Reporting more 17 years ago