VS Tools for GP9 - MDI Forms

Is there a way to make a custom Visual Studio (.net) form act like a regular 
GP MDI  child form?  (Stay visible - not modal)

I have a custom form tied to the the SopEntry form which will display 
additional data about the orders.  However it does not stay visible unless it 
has focus. I need a way for the custom form to be visible while GP and it's 
other forms have focus. However still give way (allow them on top) to other 
forms in the MDI.  

On a side note, it would really be nice if there is a way to get the size 
and location of a GP child form as well so that I could move and resize them 
custom Window according to it's master GP form.

Any Suggestions?

Thanks,
Jim Harkins
0
JimHarkins (11)
8/17/2007 1:06:00 AM
greatplains 29623 articles. 6 followers. Follow

3 Replies
681 Views

Similar Articles

[PageSpeed] 53

Figured it out myself... here is the answer:

namespace BlaBlaBla
{
    public partial class RegInfo : DexUIForm
    {
        [DllImport("User32.dll")]
        public static extern int MessageBox(int h, string m, string c, int 
type);

        [DllImport("user32.dll")]
        private static extern int FindWindowEx(int hWnd1, int hWnd2, string 
lpsz1, string lpsz2);

        [DllImport("user32.dll")]
        private static extern int SetParent(int hWndChild, int hWndNewParent);

        public RegInfo()
        {
            InitializeComponent();
            
            
            int hWndParent = 0;
            int hWndMDI = 0;
            hWndParent = FindWindowEx(0, 0, "TNTMAIN", "Microsoft Dynamics 
GP");
            if (hWndParent != 0)
            {
                hWndMDI = FindWindowEx(hWndParent, 0, "MDIClient", 
"Dexterity Runtime");
                if (hWndMDI != 0)
                {

                    int hWnd = this.Handle.ToInt32();

                    if (SetParent(hWnd, hWndMDI) != 0)
                        MessageBox(0, "Success", "API Demo", 0);
                }
            }
        }
    }
}
0
JimHarkins (11)
8/17/2007 7:38:01 PM
ANSWER:

namespace BlaBlaBla
{
    public partial class RegInfo : DexUIForm
    {
        [DllImport("User32.dll")]
        public static extern int MessageBox(int h, string m, string c, int 
type);

        [DllImport("user32.dll")]
        private static extern int FindWindowEx(int hWnd1, int hWnd2, string 
lpsz1, string lpsz2);

        [DllImport("user32.dll")]
        private static extern int SetParent(int hWndChild, int hWndNewParent);

        public RegInfo()
        {
            InitializeComponent();
            
            
            int hWndParent = 0;
            int hWndMDI = 0;
            hWndParent = FindWindowEx(0, 0, "TNTMAIN", "Microsoft Dynamics 
GP");
            if (hWndParent != 0)
            {
                hWndMDI = FindWindowEx(hWndParent, 0, "MDIClient", 
"Dexterity Runtime");
                if (hWndMDI != 0)
                {

                    int hWnd = this.Handle.ToInt32();

                    if (SetParent(hWnd, hWndMDI) != 0)
                        MessageBox(0, "Success", "API Demo", 0);
                }
            }
        }
    }
}
0
JimHarkins (11)
8/17/2007 7:40:07 PM
Hi dear.
the Source code does good  work, but
have problem with the time,
the error is related with 'error Smart Head'

Good luck
-- 
IT - Developer


"Jim Harkins" wrote:

> ANSWER:
> 
> namespace BlaBlaBla
> {
>     public partial class RegInfo : DexUIForm
>     {
>         [DllImport("User32.dll")]
>         public static extern int MessageBox(int h, string m, string c, int 
> type);
> 
>         [DllImport("user32.dll")]
>         private static extern int FindWindowEx(int hWnd1, int hWnd2, string 
> lpsz1, string lpsz2);
> 
>         [DllImport("user32.dll")]
>         private static extern int SetParent(int hWndChild, int hWndNewParent);
> 
>         public RegInfo()
>         {
>             InitializeComponent();
>             
>             
>             int hWndParent = 0;
>             int hWndMDI = 0;
>             hWndParent = FindWindowEx(0, 0, "TNTMAIN", "Microsoft Dynamics 
> GP");
>             if (hWndParent != 0)
>             {
>                 hWndMDI = FindWindowEx(hWndParent, 0, "MDIClient", 
> "Dexterity Runtime");
>                 if (hWndMDI != 0)
>                 {
> 
>                     int hWnd = this.Handle.ToInt32();
> 
>                     if (SetParent(hWnd, hWndMDI) != 0)
>                         MessageBox(0, "Success", "API Demo", 0);
>                 }
>             }
>         }
>     }
> }
0
Megasoft2 (2)
11/13/2007 12:14:03 PM
Reply:

Similar Artilces:

IE5Setup.exe & Inbox Repair Tool
Yesterday after loading the Window XP sp2 Outlook Express disappeared. I can't get it back. ANd Outlook 2000 doesn't work either. And My address book and saved email are in Outlook Express. I'm freaking out. Two error messages are popping up. When I try to get in Outlook 2000 to pop up says.... "Microsoft Outlook Express requires 4.01 or greater. You can install Microsoft Outlook Express 5.0 by running IE5Setup.exe from the Internet Explorer folder where you installed Outlook or from the Internet Explorer site on Microsoft Web." When I go to my computer I...

Changing task ownership after Inbox Repair Tool
I recently had to run the Inbox Repair Tool to fix a corrupted outlook.pst file. After this, when I'd try to modify a task and save it, it would say "You do not own this task. Your changes may be overwritten by the task owner." I've never had multiple users or assigned tasks or anything like that. Does anybody know how I can change the owner of these tasks back to what it should be? -Eric ...

How do I create a windows form that is an ellipse
Hi! Normally when you create a form it's shape is a rectangle. Now I want to create a windows form that is not a rectangle but an ellipse instead I wonder if anyone have some good example of code where this is done. //Tony "Tony Johansson" <johansson.andersson@telia.com> wrote in message news:ec84YWZ0KHA.348@TK2MSFTNGP02.phx.gbl... > Hi! > > Normally when you create a form it's shape is a rectangle. > Now I want to create a windows form that is not a rectangle but an ellipse > instead > I wonder if anyone have some good ex...

count visible records only on continuous forms
I would like to programmitically count # of visible records/rows in a continuous forms or datasheet format. So, I may have 200 records as the total recordcount in my recordset, but, I want to know how many are actually visible in the window. The reason for this is that I am basing the size of a subform's height, which contains continuous forms, on the window height. I want to be able to determine the top record displayed and the last record displayed. Again, this is regardless of how many actuall records exist in the recordcount. Any help is appreciated. MPM1100 wrote: >I w...

Missing Microsoft Word 10.0 Object Library
This happens when anyone opens my file created in Excel 2000 with Excel XP instead. My file creates a word doc from excel. How can I modify my code below to make it able to differentiate between Microsoft Word 9.0 Object Library and the 10.0 Object Library Dim wrd As Word.Application Use late binding Dim wrd As Object Set wrd = CreateObject("Word.Application") -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "LI" <anonymous@discussions.microsoft.com> wrote in message ne...

Can't see my pop up form
Hi all, I tried searching, but didn't find anything to help, so here goes... Access 2003. I have a form for data entry. I also have a button on this form to pop up another form to add in new values. When I click the button, I am unable to click on anything (just get the annoying bing), and the form never show's up. The only way I have been able to get out of it is to "Shift - Tab" then hit enter (so I know the fom loaded and has focus - as this causes the Cancel button to be clicked). When I do this, focus comes back to my main form. I am testing out an MDE, so I couldn&...

online form creation
What is the best recommended way for creating online forms on a web site. I would like the information to be retained in a db as well as having the option of email the completed online form to someone in our office. Running Server 2003 and iis6 http://www.webmonkey.com/webmonkey/backend/databases/tutorials/tutorial3.html "Mark" <rmwatrich@hotmail.com> wrote in message news:6E36CC0F-EC6B-44D3-83CC-584AF5FFE90D@microsoft.com... > What is the best recommended way for creating online forms on a web site. > I would like the information to be retained in a db as well...

Form and record selection
i'm an access newcomer, so forgive me if i don't detail my question properly. basically, i'm creating a basic database and a form to input data into that database. i'd like to create a form that uses a combo box with a list of company names and when the user clicks on or types in the company name access will pull up the record. as it is, i can only edit records by clicking on the arrow keys at the bottom of the page. also, every time i click on my form, it opens with "enter parameter value" with "Overview.CEO" underneath. how do i get rid of tha...

Need Query or Macro to Update Form
I have a form with two textboxes, both tied to field names in the table I am using for the form. The two fields are GroupName1 and Groupname2. I need to build a query or macro to run where if there is any text in Groupname2, to transfer the text to a new record where the text from Groupname2 is now in Groupname1 field. Please help!!! Thanks. Chris You've described "how" you want to solve a situation... but we have no idea what situation this is supposed to solve! More specific descriptions will probably lead to more specific suggestions. -- Regards Jeff Boyce www.In...

tabbed form becomes blank on form view
Hi clever people, I have a tabbed form with data from a tblMain on the 1st tab. That's all fine. I have address details in a tblBusAdr & tblpersAdr for business & personal addresses since there will be multiple records for the same addresses. My 2nd tab is where I want the address data to appear & although there is relationships for PK & FK between the 3 tables my form detail goes blank even though the fields show a valid source. Am I trying to do something which is not possible or do I have to use a subform on the tab? If needed I can post the access g...

inbox repair tool- can not open microsoft outlook 2007
when i try to open microsoft outlook 2007, i get a : " cannot start microsoft office outlook, cannot open the outlook window, the set of folders cannot be opened,. errors have been detected in the file c:/users/korinasoffice/appdata/local/microsoft/office/outlook.pst" use the inbox repair tool (scanpst.exe) to diagnose and repair errors in the file. how do i fix this???? You use the tool scanpst.exe to fix the data file. You can do a search, make sure you enable the search to go through hidden files and folders. When scanpst.exe is found, double-click it. Follow ...

Welcome to OutlookFreeware.com: more than 70 free Microsoft Outlook Add-ins, Tools and Utilities
1. Export Messages to EML Format Exports messages to EML format using a specified folder. It is possible to retain the original Outlook folder structure. http://www.OutlookFreeware.com/en/products/all/OutlookMessagesExportEML 2. Add Attachments Attaches files from a specified folder to messages. It is possible to skip files with identical names. http://www.OutlookFreeware.com/en/products/all/OutlookAttachmentsAdd 3. Pack Attachments Packs attachments using specified file mask to one or more ZIP archives. Attaches resulting archives and deletes source attachments. Thus it becomes possible to ...

Questions About VS 2005
I still haven't seen my copy of VS 2005 yet. I'm wondering if anyone who's got it could answer a question for me. I'm wondering if VS 2005 has added anything new regarding visual elements for MFC applications. This could include new stuff relating to skins, newer toolbar images, or anything else that is updated to make any part of the application look more like newer Office apps, etc. Thanks for any info on this. -- Jonathan Wood SoftCircuits http://www.softcircuits.com "Jonathan Wood" <jwood@softcircuits.com> wrote in message news:uVHZoYADGHA.4080@T...

Table / Form Design for Headcount Report
Hello, First, I'm not sure if this a "tables" design question or "forms" question so I'm posting in both groups. I receive a daily force / headcount report of non-resident contractors on site for the day. The report lists the number of people on site, by craft (pipefitter, electrician, etc.). While we usually have five or six crafts onsite daily, there are a total of twenty possible crafts to choose. I'd like this data in some sort of table for analysis. I guess the "quick and dirty" way is to put the data in an Excel spreadsheet / pivot tab...

VS Tools
In the EstimateFreight sample there is a "GPConnObj.Init" is it I need to supply the same registration key like in GP "Tools >> Setup >> System >> Registration"? Thanks ...

Applying Exchange Calendar Update Tool (KB930879)
OK I'm a bit confused here. In the documantation for the Exchange Calendar Update Tool (KB930879) it gives you a list of 5 scenarios in which you can apply changes. The first option is listed below. Option: Distribute the Outlook tool to each user, and then instruct users to update their own mailboxes. Pros: This option avoids the risks and limitations of running the Exchange tool. Cons: It is difficult to guarantee that all users will run the Outlook tool correctly and in a timely manner. Users who do not have Outlook will be unable to run the Outlook tool. An additional educational ef...

Lock a form
I'm currently using Access 2007 and I would like to lock down controls in a form with a button, but AFTER it has been edited by the user. In this forum, I read about some pretty clever coding for locking bound controls, but it doesn't quite fit my needs. The new forms usually open in a locked state (which bothers me a bit since data will be added regularly), while some blank textboxes, that the user has to fill by himself, are not locked at all. I would like the form to open unlocked by default (or at least apply no locks on a newly created form), so that the user can ma...

Command Button on Form
I have my form competed and it is doing everything I want it to do. Now I have added a command button to open a preview report. The button shows in the design view but disappears in form view. I had it working fine a couple of times and then it up and disappears again. What is going on? I have tried deleting the button and going back through the process of installing it and again it will show in design and then disappear in form view. Help -- Bandit The following are possible: * There is code that hides controls, and your new button falls foul of that; * you have inadve...

Any ways of exporting an Invoice Form in SOP to either Word or Exc
Hi Is there any way to export an Invoice Form (Blank, Short, Long) that is printed from SOP to either Word or Excel? I know that Smartlist provides you the ability to do this, and you can always send the form to text file (Send to) convert to Excel, but is there a way to do this via Excel the easiest way or Word? Thanks! You want to print an invoice to an Excel format, is that correct? If so, I'm not aware of any direct method. There might be a third party product that will accomplish this. "Bryan Hipolito" wrote: > Hi > > Is there any way to export an...

Tool to monitor Business Portal
I would like to see a tool or utility similar to Great Plains's "User Activity" feature to allow me to monitor who is logged onto the Portal and give me the ability to kick people off when necessary. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http:/...

Viewing task Name on Tools Bar
I lost the option of viewing the task name on the Tools Bar.. I believe there is a set up someone that must of been turned off.. Any suggestions? Hi Lori, Sorry, I don't understand your question. The task name appears in the task name column. Are you looking to have the name appear on the task bar in the Gantt chart? Try Format > Bar Styles, select the "task" bar and select "Name" from the left, right, above or below area on the Text tab. If this is not what you needed, please be clearer about what you mean by the "task name on the Tools Bar...

Installing the Exchange Calendar Update tool
Hey guys and gals, Two items of conusion for me: 1. When running the Exchange Calendar update tool (I don't trust my users to even read my email), I have to have access to all users's mailboxes in order to adequately run the tool. Which group do I have to place myself into to do this, or which permission do I need to change. I am in both the Enterprise Admin and Domain Admin roles. This is for an SBS 2003 install. When I run the tool I get errors that mailboxes cannot be accessed. 2. The TZMove.exe tool, which is supposed to be downloaded, but not the installer, which also has ...

CRM Forms J Script
Hi I want to update an attribute on the contact form when a phone call for the contact is closed. Can someone please advise me how i could go about this? Any help would be appreciated. Kind Regards Ridhima ...

What happens with forms after windows is unlocked
I have several subforms set to function for data entry only (edits, deletes, navigation disabled; additions, data entry enabled). Everything works fine until I lock and unlock my computer. Several seconds after the computer is unlocked both subforms select and display an existing record. In one case it's the first record in the table, in the other a record in the middle and I can't figure out what's special about it. I've tried sticking event handlers on what I though were the most like events to blame but all I've managed to figure out is that whatever is going on is oc...

closing a form that uses a Dlookup
I have a form I use to enter new production requirements in to a table. On that form I have a the following controls Code Qty Needed Date Needed Plan Date The Code control has the following VBA on the On Exit event: Private Sub fldcode_Exit(Cancel As Integer) Dim varrtgno As String Dim vardays As Double Dim varfstop As Date Dim varplandate As Date varrtgno = DLookup("[rtg_no]", "dbo_imitmidx_sql", "[item_no]='" & [Forms]![frm enter fillroom requirements]![fldcode] & "'") 'Me!rtgno = varrtgno Select Case varrtgno ' some cas...