Search found 101 matches

by Allen
Wed Sep 24, 2025 11:36 am
Forum: Coding Questions
Topic: SendInput problem with win gadget [SOLVED]
Replies: 4
Views: 292

Re: SendInput problem with win gadget (SOLVED)

Hi,

I found my mistake. Sendinput only send to the window in focus. To change the focus to desktop, I need to hide/minimize the count down window first. Add "HideWindow(0,#True): before CaptureScreen() the program will work.

Allen
by Allen
Wed Sep 24, 2025 9:32 am
Forum: Coding Questions
Topic: SendInput problem with win gadget [SOLVED]
Replies: 4
Views: 292

Re: SendInput problem with win gadget

Hi,

I would like to explain what I want to do, a popup window with STOP button and a count down timer, if no user inout, at the end of the count down, the screen will be capturedd and image saved .

UseJPEGImageDecoder()
UseJPEGImageEncoder()
EnableExplicit

Procedure CaptureScreen()
Protected ...
by Allen
Wed Sep 24, 2025 8:29 am
Forum: Coding Questions
Topic: SendInput problem with win gadget [SOLVED]
Replies: 4
Views: 292

Re: SendInput problem with win gadget

BarryG,

Yes, you are right, I can paste the image in PAINT after the program ended eventhough the ImageID return is zero. However, in the program, ImageID return zero (Image not initialized) means I cannot use other image command such as SaveImage(ImgeID,..) command to save the image inside the ...
by Allen
Wed Sep 24, 2025 6:07 am
Forum: Coding Questions
Topic: SendInput problem with win gadget [SOLVED]
Replies: 4
Views: 292

SendInput problem with win gadget [SOLVED]

Hi,

In below code, if I comment out line ";MessageRequester("Wait","Wait Capture screen to complete")" , the progam does not work, I cannot replace it with a delay() command such that no user inout is required. Any suggestion? Without the CreateWin(), the capture screen also works ...
by Allen
Sat Feb 01, 2025 6:19 am
Forum: Coding Questions
Topic: Simulate button gadget is pressed
Replies: 5
Views: 1576

Re: Simulate button gadget is pressed

Hi Idle,

Thanks you for the example, it is what I am looking for.

Thanks

Allen
by Allen
Sat Feb 01, 2025 5:35 am
Forum: Coding Questions
Topic: Simulate button gadget is pressed
Replies: 5
Views: 1576

Simulate button gadget is pressed

Hi all,

I am looking for a method to simulate a button gadget is pressed. I searched the forum and found this command :
"PB_Gadget_SendGadgetCommand(GadgetID(#Gadget), #PB_EventType_LeftClick)"

However, it seems this command is no longer available, any suggestion?

Thanks

Allen
by Allen
Sat Nov 30, 2024 1:54 pm
Forum: Coding Questions
Topic: window api question - DestroyWindow()
Replies: 4
Views: 823

Re: window api question - DestroyWindow()

Axolotl,

No worries. I did learned a lot from your advices (and from other members). Thank you again for your help all along.

Allen
by Allen
Thu Nov 28, 2024 5:11 pm
Forum: Coding Questions
Topic: window api question - DestroyWindow()
Replies: 4
Views: 823

Re: window api question - DestroyWindow()

Axolotl,

It works, thanks the help.

I did test use the webgadget (PB built-in) to replace the use of chrome, however it seems the HTML code return from - GetGadgetItemText() with #PB_Web_HtmlCode flag did not encode chinese char properly . Web page display correctly, but content of HTML does not ...
by Allen
Thu Nov 28, 2024 2:25 pm
Forum: Coding Questions
Topic: window api question - DestroyWindow()
Replies: 4
Views: 823

window api question - DestroyWindow()

Hi,

I would like to use runprogram() to open a chrome window and then later close it (not minimize )

Below is my attempt using examples from other experienced member (thanks for their contribution).

The API Closewindow (line 44) work as expected but when I use DestroyWindow (line 43) it failed ...
by Allen
Wed Oct 09, 2024 3:13 pm
Forum: Coding Questions
Topic: Tree Gadget selection problem
Replies: 2
Views: 498

Re: Tree Gadget selection problem

Hi,

Kiffi, Thank you for the quick response and the information. I add checking for the EventType and it now work as expected.

Thanks

Allen

If OpenWindow(0, 0, 0, 355, 180, "TreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TreeGadget(0, 10, 10, 160, 160) ; TreeGadget standard ...
by Allen
Wed Oct 09, 2024 2:36 pm
Forum: Coding Questions
Topic: Tree Gadget selection problem
Replies: 2
Views: 498

Tree Gadget selection problem

Hi,

I am learning to use the tree gadget. I modified the example of the help file and want to get the item whenever its checkbox is checked. In below code the message appear twice whenever I tick a item's checkbox. Please advise.

Working in win 10 pro PB 6.11

Thanks

Allen

If OpenWindow(0, 0 ...
by Allen
Sat Sep 14, 2024 4:24 am
Forum: Coding Questions
Topic: Mouse status in desktop
Replies: 5
Views: 1153

Re: Mouse status in desktop

Hi RASHAD,

Thank you for the example. Definitely able to learn new technique from them.

Thanks

Allen
by Allen
Fri Sep 13, 2024 4:18 pm
Forum: Coding Questions
Topic: Mouse status in desktop
Replies: 5
Views: 1153

Re: Mouse status in desktop

Hi Axolotl,

Thank you for your example. It surely gives me a direction where to look for further information.

Hi RASHAD,

As most of my programming knowledge only comes from using Purebasic (learn from examples in help doc) and infromation from this forum. I do not understand your advise. I ...
by Allen
Fri Sep 13, 2024 8:52 am
Forum: Coding Questions
Topic: Mouse status in desktop
Replies: 5
Views: 1153

Mouse status in desktop

Hi,

DesktopMouseX() and DesktopMouseY() can return the coordinate of the mouse in dektop. How can I check if any of the mouse button is pressed. The mouse will not be inside any window gadget.

I only run in window. 10

Thanks.

Allen
by Allen
Wed May 01, 2024 2:26 am
Forum: The PureBasic Editor
Topic: Keep debug window open after program ends
Replies: 11
Views: 2992

Re: Keep debug window open after program ends

Hi Jassing,

May be you could try to use the standalone debugger.

Thanks

Allen