You are currently browsing all posts tagged with Windows API

PowerBuilder – Writing to the Windows Event Log

Posted on February 13, 2013 at 5:32 pm in

Here are  two ways to write to the Event log in Windows and indicate the source of the message. Reportevent External Function and Eventcreate command line command You can use the command shell to do this too but this has the drawback of not being able to assign the source of the event. First you need…

PowerBuilder – Writing to the Windows Event Log - the full story »

Comment on PowerBuilder – Writing to the Windows Event Log »

PowerBuilder – Resizing a Response Window or User Object

Posted on May 23, 2012 at 5:16 pm in

Here is a technique you can use to resize a response window or userobject as needed. It makes use of the GetWindowLong and SetWindowLong Windows API methods. The oldest reference I found to this is from Eric Aling back in 2000. In a nutshell, you are changing the border around the object to one which…

PowerBuilder – Resizing a Response Window or User Object - the full story »

3 Comments on PowerBuilder – Resizing a Response Window or User Object »

Powerbuilder – Finding special folders – FDCC Compliance

Posted on February 14, 2012 at 6:03 pm in

Here is a link to an article by Bruce Armstrong relating to new functionality in PB11.5.  The article specifically deals with FDCC (Federal Desktop Core Configuration)  Compliance in PB apps and specifically the SHGetFolderPath Windows API function.  Although this information has been available for awhile, it’s worth noting again. Usage Notes: function ulong SHGetFolderPath(ulong hwndOwner, long nFolder,…

Powerbuilder – Finding special folders – FDCC Compliance - the full story »

Comment on Powerbuilder – Finding special folders – FDCC Compliance »

Powerbuilder – Selecting and scrolling to an entry in a Listview control

Posted on August 17, 2011 at 8:20 pm in

The listview control in PB lacks the capability to scroll to a highlighted item within the native Powerscript. Here is an easy way to do this by simulating key strokes. First declare the following API subroutine. keybd_event( int bVk, int bScan, int dwFlags, int dwExtraInfo) Library “user32.dll” Next create a user event in the listview…

Powerbuilder – Selecting and scrolling to an entry in a Listview control - the full story »

Comment on Powerbuilder – Selecting and scrolling to an entry in a Listview control »

Powerbuilder – Folder Selection Dialog Window

Posted on June 23, 2011 at 8:20 pm in

Here is an NVO used to envoke a Windows folder selection dialog since Powerbuilder does not have it’s own version. You can change the API calls to ANSI for earlier versions of PB. I’ve had this squirreled away for awhile and I no doubt got it from someone else off the web. Thanks! // window…

Powerbuilder – Folder Selection Dialog Window - the full story »

Comment on Powerbuilder – Folder Selection Dialog Window »

Powerbuilder – Treeview like Tooltips for Datawindows

Posted on May 18, 2011 at 8:20 pm in

The treeview control has a very neat piece of functionality built in called Tooltips. When this property is checked your application will automatically display all the text on a treeview item if it is cut off by the edge of the control when the mouse pointer goes over that row. If the row text is…

Powerbuilder – Treeview like Tooltips for Datawindows - the full story »

1 Comment on Powerbuilder – Treeview like Tooltips for Datawindows »

Powerbuilder – Application path

Posted on April 19, 2011 at 8:20 pm in

So you need to check some file you have deployed with your application and you have chosen to put it in the same folder as the executable. Sure, I’ll just check the current folder when the application launches and I’ll have what I need. Wrong. Since an application can be launched with a ‘Start In’…

Powerbuilder – Application path - the full story »

Comment on Powerbuilder – Application path »

Powerbuilder – Development vs. Production Mode

Posted on February 22, 2011 at 8:20 pm in

You can set up a variety of helpful methods for use while developing an application which you don’t want users to get their hands on when in production. One example of this is my Window Information Service . To make this only available when running from the Powerbuilder IDE use the following steps. Set up…

Powerbuilder – Development vs. Production Mode - the full story »

Comment on Powerbuilder – Development vs. Production Mode »

Powerbuilder – Add /Remove a Font at Runtime

Posted on January 12, 2011 at 8:20 pm in

Here is a way to add (and remove) a font to the user’s machine at runtime. You can also use this to check if a user has a particular font installed since the code also shows how to list all the installed fonts (need MS Word for this). Way back in my PB5 days I…

Powerbuilder – Add /Remove a Font at Runtime - the full story »

Comment on Powerbuilder – Add /Remove a Font at Runtime »

Powerbuilder – Get Color Value of Pixel under Pointer

Posted on December 17, 2010 at 8:20 pm in

Here is a sample application which will give you the color value of the pixel the user clicked on on a picture control (this can be used for any object inherited from a dragobject). To see the list of draggable controls, open the Browser. All the objects in the hierarchy below dragobject are draggable. This…

Powerbuilder – Get Color Value of Pixel under Pointer - the full story »

Comment on Powerbuilder – Get Color Value of Pixel under Pointer »

Top