Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 15 of 15
  1. #1
    Join Date
    May 2006
    Posts
    5,380

    DLLUserInput.dll (my first crack)

    Hi guys,

    this is my first crack at making a dll for ams, its quite simple with just a few function but still a usable addition

    it features:

    a username/password dialog
    2 input dialog (like the password but without masked input)
    3 input dialog
    4 input dialog

    you can set the text above each input and the text of the buttons and it will return a table (useing DelimitedStringToTable) that can be used in ams

    look in atcions>>startup for the code for the password input, and all other code is in the buttons

    C&C Welcome
    Last edited by RizlaUK; 02-01-2009 at 11:35 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  2. #2
    Join Date
    May 2005
    Posts
    1,115
    A problem is that your dialog is not modal.
    You can still click on the window behind and it will responde to events,
    where it should not do that until you close the dialog.
    Never know what life is gonna throw at you.
    (Based on a true story.)

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Nice job. The only suggestion I have is to line up the labels with the input fields.

    and yes like Bule says, make it modal. Another suggestion, if you pass the Window Handle of the AMS windo to the dll, you can make the dialog a child of the AMS window so that it will always centre to the AMS windown instead of the screen.
    Last edited by Dermot; 04-23-2007 at 11:25 AM.
    Dermot

    I am so out of here

  4. #4
    Join Date
    Oct 2006
    Location
    London, UK
    Posts
    351
    Great job RizlaUK, i also agree with the modal window.

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    thanks guys......modal window, ok after 3 or 4 hours of searching im still getting nowhere, PureBasic cant make modal windows with out code that i dont yet understand, i can make a window created by a pb window modal but i cant make a window called from the dll modal, im stuck and my patience is running out fast, the help file is somewhat lacking in information and the user forum (phpbb) has a very poor search function............the search continues....
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    if you pass the Window Handle of the AMS windo to the dll, you can make the dialog a child of the AMS window so that it will always centre to the AMS windown instead of the screen.
    i have that part working ok, i am trying to disable the ams window by useing the same method but im getting nowhere fast.....any pointers ??
    Open your eyes to Narcissism, Don't let her destroy your life!!

  7. #7
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Just use EnableWindow_(WinHandle, #False) where WinHandle is the handle of the AMS window.

    Very important to use EnableWindow_(WinHandle, #True) when the dialog closes, otherwise the AMS window will be unuseable.
    Dermot

    I am so out of here

  8. #8
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Right on guys! PB & AMS!



    ps. if we all put DLL or EXE (which ever pertains) in our posts (I prefer the Subject)... it will make it easy for us to search for them later.
    Intrigued

  9. #9
    Join Date
    May 2006
    Posts
    5,380
    dam, iv been trying all night using DisableWindow in every form i could find, it would disable a window created with another pb window but not the dll window, i guess that one is local only

    Cheers Dermot "EnableWindow_(WinHandle, #False)" works a dream


    heres an a update,

    text now aligned with inputboxes
    dialogs will now appear center of the app no matter where it is on screen
    all dialogs are now modal (phew)

    now im off to see what other goodies i can come upwith
    Last edited by RizlaUK; 02-01-2009 at 11:35 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  10. #10
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    RizlaUK, I can see you creating SDK style plugins in a few weeks, months.

    Intrigued

  11. #11
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    So, when the user/pass dialog goes away (they entered the wrong info) they do not see the AMS Window and/or outline even!

    Adjust the On Startup code (scroll to see in-bold text change):


    Code:
    -- title text
    title = "My Password Input (coed in project startup)"
    -- username text
    usertext = "Enter Username (user)"
    -- password text
    passtext = "Enter Password (pass)"
    -- submit button
    Submit = "Submit"
    -- cancel button
    Cancel = "Cancel"
    -- call the dll
    result = DLL.CallFunction("AutoPlay\\Docs\\DLLUserInput.dll", "ShowPassInput", "\""..title.."\",\""..usertext.."\",\""..passtext.."\",\""..Submit.."\",\""..Cancel.."\","..Application.GetWndHandle(), DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL);
    -- check cancel was not clicked
    if result ~= "0" then
    	-- convert the string to a table
    	tbResults = DelimitedStringToTable(result,"|");
    	-- define the username and password
    	User = "user"
    	Pass = "pass"
    	
    	--check if the user and pass was the a match
    	if tbResults[1] == "user" and tbResults[2] == "pass" then
    	blnOK = true
    	else
    	blnOK = false
    	Dialog.Message("Notice", "Wrong username or password, exiting application", MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
    	end
    end
    
    -- if user and pass dident match then exit app
    if blnOK ~= true then
    	Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE)
    end
    Last edited by Intrigued; 04-23-2007 at 05:35 PM.

  12. #12
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    I mirrored your offering at www.amsuser.com:

    http://www.amsuser.com/ams/examples/...6-RizulaUK.apz

    Thanks for sharing.
    Intrigued

  13. #13
    Join Date
    May 2006
    Posts
    5,380
    thats better, i hated that flick of the app i was getting but ran out of steam and decided to leave it as it was

    and cheers for the mirror, its nice to know my first dll is worthy of hosting
    Open your eyes to Narcissism, Don't let her destroy your life!!

  14. #14
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    No problem on both counts.

    I'm looking forward to seeing more from you on the .dll front.

    Intrigued

  15. #15
    Join Date
    Nov 2003
    Location
    Myrtle Beach, SC
    Posts
    155
    @ RizlaUK:

    Congratulations. Great Work !!! And ... it fills an existing need.

    BTW, it is amazing to me that having no Basic programming or Windows API programming experience that you did this as your first project. Nice! My first one was 25 years ago in 8080/Z80 Assembly and it took me 3 days to figure out how to display 'Hello World' on a console screen (MASM 1.0 and DOS 1.0).

    Bravo! You definitely have a talent for this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts