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 »

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 »

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 (since broken) 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,…

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

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 »

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 »

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 »

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 »

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 »

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 »

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 »

Top