INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Show Confirm Dialog like Windows 10 Pro

Show Confirm Dialog like Windows 10 Pro

(OP)
Hi everybody,

Is there any Windows API that show a confirm dialog like shown image below?

Some friends of mine has made it on theirs VFP apps and i wonder if they did it using Windows API or just by Class Library designing.

If it's so, please post an example.

Thanks...!

RE: Show Confirm Dialog like Windows 10 Pro

I don't know about an API, but that would not be hard to create as a form, passed the various parameters

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Show Confirm Dialog like Windows 10 Pro

I doubt if there is an API call that actually displays this dialogue. After all, what would be the point of just displaying the dialogue? You would also need to code the actual copying of the file, the test for whether the file already exists, and the action to be taken according to the user's choice.

But I might be wrong about that. Why don't you try it for yourself? Just SET SAFETY ON, then try to copy one file over another, using COPY FILE. You will get a dialogue asking you whether you want to overwrite. See for yourself whether that is the dialogue in your screen shot, or the boring Yes / No / Cancel message box that you see in older versions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Show Confirm Dialog like Windows 10 Pro

(OP)
Mike, The image was an example just for showing the confirm dialogue style. Off course I can make it by my self using simple form but i dont want to do it that way, that's why i ask for Windows API integration.

Thanks...!

RE: Show Confirm Dialog like Windows 10 Pro

That's quite clever Mike

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Show Confirm Dialog like Windows 10 Pro

Irwin, you say the form that you showed is just an example. An example of what exactly? If you mean an example of a dialogue that appears when you try to copy one file over another ... well, that's obvious. If it's not that, what type of dialogue do you want to create (that this one is an example of)?

Also, you mentioned that your friends have an app that shows this kind of dialogue. Have you considered asking those friends how they did it?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Show Confirm Dialog like Windows 10 Pro

Sedna had the VistaDialogs4COM as one component: https://github.com/VFPX/VistaDialogs4COM

Edit: By the way the screenshot you show rather looks Aero/Vista, not Win10. Win10 has flat windows, which are even easier to emulate with no border, no theme using Labels for any text and Containers with white border to emulate flat buttons.

Bye, Olaf.

RE: Show Confirm Dialog like Windows 10 Pro

(OP)
Hi guys, I've found the solution by using the CodeJock ActiveX Components.

Thanks you all...!

RE: Show Confirm Dialog like Windows 10 Pro

Irwin,
I like this idea... how did you solve it with the CodeJock?
Can you put an example up, I wouldn't mind trying this in my own app, now that you mention it.

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Show Confirm Dialog like Windows 10 Pro

(OP)
OfCourse, here's the example.

CODE --> VFP

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	DoCreate 	= .T.
	Caption 	= "Form1"
	*-- XML Metadata for customizable properties
	_memberdata = ""
	Name 		= "Form1"


	ADD OBJECT taskdialogmarkup AS olecontrol WITH ;
		Top 		= 12, ;
		Left 		= 12, ;
		Height 		= 28, ;
		Width 		= 16, ;
		oleClass 	= "Codejock.TaskDialog.15.3.1",;
		Name 	= "taskDialogMarkup"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top 		= 72, ;
		Left 		= 24, ;
		Height 		= 96, ;
		Width 		= 312, ;
		FontSize 	= 12, ;
		Caption 	= "\<Show TaskDialog", ;
		Name 		= "Command1"


	ADD OBJECT taskdialog AS olecontrol WITH ;
		Top 		= 12, ;
		Left 		= 36, ;
		Height 		= 100, ;
		Width 		= 100, ;
		oleClass 	= "Codejock.TaskDialog.15.3.1",;
		Name 		= "taskDialog"


	PROCEDURE loaddialogs
		Local gnFileHandle,nSize,cString
		gnFileHandle = FOPEN("C:\Dialogs.xml")
		* Seek to end of file to determine number of bytes in the file.
		nSize =  FSEEK(gnFileHandle, 0, 2)     && Move pointer to EOF
		IF nSize <= 0
		 * If file is empty, display an error message.
		 WAIT WINDOW "This file is empty!" NOWAIT
		ELSE
		 * If file is not empty, store the file's contents in memory
		 * and display the text in the main Visual FoxPro window.
		 = FSEEK(gnFileHandle, 0, 0)      && Move pointer to BOF
		 cString = FREAD(gnFileHandle, nSize)
		ENDIF
		= FCLOSE(gnFileHandle)         && Close the file
		RETURN cString
	ENDPROC


	PROCEDURE command1.Click
		Thisform.TaskDialog.Reset()
		Thisform.TaskDialog.CommonButtons = 0
		Thisform.TaskDialog.CreateFromXML(thisform.LoadDialogs(),"Dialogs/Dialog[@Name='Dialog002']")
		MESSAGEBOX(Thisform.TaskDialog.ShowDialog())
	ENDPROC

ENDDEFINE
*
*-- EndDefine: form1
**************************************************
* Dialogs.xml
*<?xml version="1.0" encoding="UTF-8"?>
*<Dialogs xmlns="http://www.codejock.com/schema/TDSchema.xsd">
*	<Dialog AllowCancel="false" Name="Dialog002">
*		<WindowTitle>MyTitle</WindowTitle>
*		<MainInstruction Image="*Information">My SubTitle</MainInstruction>
*		<Content>┬┐Here's the Question or Message Content?</Content>
*		<Buttons Default="1">
*			<CommandLink Shield="true" ID="1">
*				<Text>Yes Or Accept</Text>
*				<Explanation>Button 1 Hint</Explanation>
*			</CommandLink>
*			<CommandLink ID="2">
*				<Text>No or Cancel</Text>
*				<Explanation>Button 2 Hint.</Explanation>
*			</CommandLink>
*		</Buttons>
*	</Dialog>
*</Dialogs>
************************************************** 

RE: Show Confirm Dialog like Windows 10 Pro

This is probably a good solution. I've used the Codejock ActiveX controls in several projects. They can greatly enhance the appearance of your application.

In this particular case, I probably would have created my own form from scratch using native VFP, but in general Codejock is a good place to look for this type of thing.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Show Confirm Dialog like Windows 10 Pro

(OP)
You're right Mike,

CodeJock has severals ActiveX components but there's just 1 or 2 VFP examples. What I do is analyze the VB6 examples and translate into VFP code.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close