Sign in to follow this  
Followers 0
litlmike

Paint as an Object

7 posts in this topic

I am attempting to dive into the realm of object creation! Oh noes! I have worked with objects a little, but more out of manipulating them from other scripts, rather than create my own from scratch.

I have a 2-fold question:

How do I create a Paint object for use in a GUI? But the bigger question is how do I learn this principle of knowing how to create any object?

For instance,

If I were to create an Excel object I would do the following, but how would I know to do "Excel.Application"?

$oExcel = ObjCreate("Excel.Application")oÝ÷ Ù*0ØOj)í¶¬v¬lyé­£
+^h¶¢YhÂ)àz«¢½©^Û(0¢é]"·¬yªÜ©ÚÌ®X¤zØb±«­¢+ØÀÌØí½A¥¹Ðô=©
ÉÑ ÅÕ½ÐíA¥¹Ð¹ÁÁ±¥Ñ¥½¸ÅÕ½Ðì¤

If this is confusing, my hopes are to create a graphic area for the user to create lines/shapes from a GUI.

Thanks in Advance

Share this post


Link to post
Share on other sites



Instead of creating a paint control, use guictrlcreategraphic. It can draw basic shapes and stuff. Use guictrlsetgraphic to draw different types of shapes.


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Mike, only select applications expose a COM interface. In adiition, you won't be able to "guess" how to use an interface once you discover one... you really need COM API documentation to use it (although there are methods of leaning what interfaces are available on your system, how they are used is up to the coder of the application - there are no "standards").

Knowing how long ago the Paint application was created and how little attention it has actually received since that time (I've heard it was created as an example program by a college intern at Microsoft), it is very unlikely to have a COM interface, but if it does, you should try to find it's documentation before embarking on this.

Dale

Edit: typos

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Also try the tool OLE/COM Object Viewer (read about it in the help file - Search for COM Reference).


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Mike, only select applications expose a COM interface. In adiition, you won't be able to "guess" how to use an interface once you discover one... you really need COM API documentation to use it (although there are methods of leaning what interfaces are available on your system, how they are used is up to the coder of the application - there are no "standards").

Knowing how long ago the Paint application was created and how little attention it has actually received since that time (I've heard it was created as an example program by a college intern at Microsoft), it is very unlikely to have a COM interface, but if it does, you should try to find it's documentation before embarking on this.

Dale

Edit: typos

Ahhhh... that is good to know. I am very new to this whole COM stuff, but it is very interesting to me. I have been very unsuccessful in finding materials to learn more about Paint or other apps, but then again, it is hard to recognize a good resource, since I don't even know what a good resource should look like.

It this the documentation I should be looking for?

http://msdn2.microsoft.com/en-us/library/s...int(vs.71).aspx

http://msdn2.microsoft.com/en-us/library/s...ics(VS.71).aspx

I was pming cameronsdad back and forth and we were trying to make something of this, but then he got busy with work (and presumably cameron) and so he has not been online for the last 2 weeks. This is one of his last PMs to me, based on this, is this the route he was talking about?

neat, i was thinking about embedding a paintbrush object for it. then you could have formations saved, and loaded in based on user input, and then they could draw on it and save etc as simply as with mspaint. i didn't get around to actually doing it though, but i don't think it would be too hard if you'd like me to whip up an example later

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0