Hallo,
habe vor kurzen mit Pure Basic angefangen und hätte eine erste Frage wie man ein Popup Fenster Codet.
Also wenn man zum Beispiel mit dem Mauszeiger über eine bestimmte Stelle des Programms geht und an der Stelle paar Sekunden bleibt (kann ein Button oder auch ein Text, das mir Variable Werte anzeigt, sein) das dann ein Popup Fenster erscheint.
Der Inhalt des Popup Fensters sollte dann als Beispiel einen Info Text mit Variable Werte anzeigen und bei bewegen des Mauszeiger soll es wieder verschwindet.
Danke im voraus.
Gruß
NeoRon
PopUp Informations Fenster anzeigen lassen
PopUp Informations Fenster anzeigen lassen
The World is Cyber
- ts-soft
- Beiträge: 22292
- Registriert: 08.09.2004 00:57
- Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel - Wohnort: Berlin
Re: PopUp Informations Fenster anzeigen lassen
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

Re: PopUp Informations Fenster anzeigen lassen
falls nicht, hier noch die andere Möglichkeit: BalloonTooltip:ts-soft hat geschrieben:Ich hoffe mal, das meinste
Code: Alles auswählen
; Quelle: http://www.purebasic.fr/english/viewtopic.php?p=66304#p66304
; auf die Schnelle auf 5.11 angepasst...
#TRAY_ID = 999
#NIM_ADD = $0
#NIM_MODIFY = $1
#NIM_DELETE = $2
#NIF_MESSAGE = $1
#NIF_ICON = $2
#NIF_TIP = $4
#NIF_STATE = $8
#NIF_INFO = $10
#NIS_SHAREDICON = $2
#NIFF_NONE = $0
#NIIF_INFO = $1
#NIIF_WARNING = $2
#NIIF_ERROR = $3
#NIIF_NOSOUND = $10
#NIN_BALLOONSHOW=$402
#NIN_BALLOONHIDE=$403
#NIN_BALLOONTIMEOUT =$404
#NIN_BALLOONUSERCLICK=$405
#NOTIFYICON_VERSION = $3
#NOTIFYICONDATA_V1_SIZE = 88
#NOTIFYICONDATA_V2_SIZE = 488
#NOTIFYICONDATA_V3_SIZE = 504
Enumeration
#Window_0
#TRAYICON_0
#image_0
EndEnumeration
Structure IconData
cbSize.l
hwnd.l
uID.l
uFlags.l
uCallbackMessage.l
hIcon.l
szTip.b[128]
dwState.l
dwStateMask.l
szInfo.b[256]
StructureUnion
uTimeout.l
uVersion.l
EndStructureUnion
szInfoTitle.b[64]
dwInfoFlags.l
EndStructure
Procedure MyWindowCallback(WindowID, Message, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
Select Message
Case #WM_USER
Select lParam
Case #WM_LBUTTONDOWN
Debug "Left mousebutton click on Icon"
Case #WM_RBUTTONDOWN
Debug "Right mousebutton click on Icon"
Case #WM_LBUTTONDBLCLK
Debug "Left button doublecklick on Icon"
Case #WM_MOUSEMOVE
;Debug "Mouse moved over TrayIcon"
Case #NIN_BALLOONSHOW
Debug "SHow balloon"
Case #NIN_BALLOONTIMEOUT
Debug "Timeout or X pressed" ; The 'X' doesn't seem to be available in W2K?!
Case #NIN_BALLOONUSERCLICK
Debug "Balloon user click"
Case #NIN_BALLOONHIDE
Debug "Balloon closed"
EndSelect
EndSelect
ProcedureReturn Result
EndProcedure
Procedure.w GetDataSize()
If OpenLibrary(1,"VERSION.DLL")
BuffSize.l= CallFunction(1, "GetFileVersionInfoSizeA", @"shell32.dll",0)
If BuffSize>0
databuf.s=Space(BuffSize-1)
;Dim databuf.b(BuffSize-1)
Result=CallFunction(1,"GetFileVersionInfoA", @"shell32.dll",0,BuffSize,@databuf)
Result=CallFunction(1,"VerQueryValueA",@databuf, @"\",@lpBuffer,@puLen)
CopyMemory(lpBuffer+10,@nVerMajor,2)
EndIf
CloseLibrary(1)
Select nVerMajor
Case 6
ProcedureReturn #NOTIFYICONDATA_V3_SIZE
Case 5
ProcedureReturn #NOTIFYICONDATA_V2_SIZE
Default
ProcedureReturn #NOTIFYICONDATA_V1_SIZE
EndSelect
EndIf
EndProcedure
Procedure StatusAreaAddIcon(tooltiptext.s)
Balloon.IconData\cbSize=GetDataSize()
Balloon\hwnd = WindowID(#Window_0)
Balloon\uID = #TRAY_ID
Balloon\uFlags = #NIF_MESSAGE | #NIF_ICON | #NIF_TIP
Balloon\hIcon = ImageID(#image_0)
Balloon\dwState = #NIS_SHAREDICON
Balloon\uCallbackMessage=#WM_USER
If OSVersion() < #PB_OS_Windows_2000
Balloon\uVersion = 0
Else
Balloon\uVersion = #NOTIFYICON_VERSION
EndIf
Balloon\uTimeout = 11000 ; The balloon will not disappear if you don't move the mouse!
Balloon\dwInfoFlags = #NIIF_INFO
If Balloon.IconData\cbSize=#NOTIFYICONDATA_V1_SIZE
PokeS(@Balloon\szTip, tooltiptext,64)
Else
PokeS(@Balloon\szTip, tooltiptext,128)
EndIf
Result= CallFunction(0,"Shell_NotifyIcon",#NIM_ADD,@Balloon)
EndProcedure
Procedure StatusAreaRemoveIcon()
Balloon.IconData\cbSize=GetDataSize()
Balloon\hwnd = WindowID(#Window_0)
Balloon\uID = #TRAY_ID
Result= CallFunction(0,"Shell_NotifyIcon",#NIM_DELETE,@Balloon)
EndProcedure
Procedure ShowBalloonTip(title.s,maintext.s,tooltiptext.s,IconType.l)
Balloon.IconData\cbSize=GetDataSize()
Balloon\hwnd = WindowID(#Window_0)
Balloon\uID = #TRAY_ID
Balloon\uFlags = #NIF_INFO | #NIF_MESSAGE | #NIF_ICON | #NIF_TIP
Balloon\hIcon = ImageID(#image_0)
Balloon\dwState = #NIS_SHAREDICON
Balloon\uCallbackMessage=#WM_USER
Balloon\uTimeout = 10000
If OSVersion() < #PB_OS_Windows_2000
Balloon\uVersion = 0
Else
Balloon\uVersion = #NOTIFYICON_VERSION
EndIf
Balloon\dwInfoFlags = IconType
If Balloon.IconData\cbSize=#NOTIFYICONDATA_V1_SIZE
PokeS(@Balloon\szTip, tooltiptext,64)
Else
PokeS(@Balloon\szTip, tooltiptext,128)
PokeS(@Balloon\szInfo,maintext.s,255)
PokeS(@Balloon\szInfoTitle,title.s,63)
EndIf
Result= CallFunction(0,"Shell_NotifyIcon",#NIM_MODIFY,@Balloon)
EndProcedure
OpenLibrary(0,"shell32.dll")
If OpenWindow(#Window_0,0,0,300,90,"Status Area(Systray) Balloon tip example",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ButtonGadget (1, 50, 10,200, 20, "Add Status area icon")
ButtonGadget (2, 50, 30,200, 20, "Show Balloon tip")
ButtonGadget (3, 50, 50,200, 20, "Remove Icon")
CatchImage(#image_0,?Icon)
SetWindowCallback(@MyWindowCallback())
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadget()
Case 1
StatusAreaAddIcon("Tool tip text")
Case 2
ShowBalloonTip("Status Area Balloon Tip demo","This is the first line"+Chr(13)+"This should be the second line","Tool tip text",#NIIF_INFO)
Case 3
StatusAreaRemoveIcon()
EndSelect
EndSelect
Until EventID = #PB_Event_CloseWindow
StatusAreaRemoveIcon()
CloseLibrary(0)
EndIf
End
DataSection
Icon:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\CdPlayer.ico"
EndDataSection
a²+b²=mc²
- ts-soft
- Beiträge: 22292
- Registriert: 08.09.2004 00:57
- Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel - Wohnort: Berlin
Re: PopUp Informations Fenster anzeigen lassen
Aber dann dazu schreiben, nur win32 im ASCII-Modus 

PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

Re: PopUp Informations Fenster anzeigen lassen
Hey,
danke für die schnelle Antworten!
Hat mir weitergeholfen.
Scheint hier ne Super gute Community zu sein.
Daumen hoch 
Grüße
NeoRon
danke für die schnelle Antworten!
Hat mir weitergeholfen.
Scheint hier ne Super gute Community zu sein.



Grüße
NeoRon
The World is Cyber